home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Technical Documentation / MPW 411 / MPWHelp < prev    next >
Encoding:
Text File  |  1992-02-12  |  377.4 KB  |  10,721 lines  |  [TEXT/MPS ]

  1. æKY CopyrightNotice
  2. æC  Copyright Apple Computer, Inc. 1986-1991, All rights reserved.
  3. 411 - MPW Help - MPW E.T.O.#7 Latest.
  4. Thursday, February 6, 1992 10:42:09 AM
  5.  
  6. MPW 3.2 Help Summaries
  7.  Help information is available for each of the MPW commands.  
  8.  To see the list of commands select Help and type command - 1. In addition, 
  9.  brief descriptions of Expressions, Patterns, Selections, Characters,
  10.  Shortcuts, Variables, and Projector are also included.
  11.  
  12.  To see Help summaries, Select one of the following and type command - 1
  13.  
  14.  a commandName  # information about commandName
  15.  Commands       # a list of commands
  16.  Expressions    # summary of expressions
  17.  Patterns       # summary of patterns (regular expressions)
  18.  Selections     # summary of selections
  19.  Characters     # summary of MPW Shell special characters
  20.  Shortcuts      # summary of MPW Shell shortcuts
  21.  Variables      # summary of the standard MPW shell variables
  22.  Projector      # summary of Projector, a project/source control system
  23.  
  24.  Copyright Apple Computer, Inc. 1986-1990
  25.  All rights reserved.
  26.  
  27. æKY Commands
  28. æC              MPW Commands -- A list of MPW executable commands
  29.  
  30.  AddMenu         # add a menu item
  31.  AddPane         # split the window into panes
  32.  Adjust          # adjust lines
  33.  Alert           # display an alert box
  34.  Alias           # define or write command aliases
  35.  Align           # align text to left margin
  36.  Asm             # MC68xxx Macro Assembler
  37.  Backup          # folder file backup
  38.  Beep            # generate tones
  39.  Begin           # group commands
  40.  Break           # break from For or Loop
  41.  Browser         # invoke Marker Browser
  42.  BuildCommands   # show build commands
  43.  BuildMenu       # create the Build menu
  44.  BuildProgram    # build the specified program
  45.  C               # C compiler
  46.  Canon           # canonical spelling tool
  47.  Catenate        # concatenate files
  48.  CFront          # C++ to C translator
  49.  CheckIn         # check a file into a project
  50.  CheckOut        # check a file out from a project
  51.  CheckOutDir     # specify the directory where checked out files will placed
  52.  Choose          # choose or list network file server volumes and printers
  53.  Clear           # clear the selection
  54.  Close           # close specified windows
  55.  CMarker         # generate Mark commands for C and C++ function definitions
  56.  Commando        # present a dialog interface for commands
  57.  Compare         # compare text files
  58.  CompareFiles    # compare text files and interactively view differences
  59.  CompareRevisions# compare two revisions of a file in a project
  60.  Confirm         # display a confirmation dialog box
  61.  Continue        # continue with next iteration of For or Loop
  62.  Copy            # copy selection to Clipboard
  63.  Count           # count lines and characters
  64.  CPlus           # script to compile C++ source
  65.  CreateMake      # create a simple makefile
  66.  Cut             # copy selection to Clipboard and delete it
  67.  Date            # write the date and time
  68.  Delete          # delete files and directories
  69.  DeleteMenu      # delete user-defined menus and menu items
  70.  DeleteNames     # delete user-defined symbolic names
  71.  DeletePane      # delete panes from the window
  72.  DeleteRevisions # delete previous revisions of files in a project
  73.  DeRez           # resource decompiler
  74.  Directory       # set or write the default directory
  75.  DirectoryMenu   # create the Directory menu
  76.  DoIt            # highlight and execute a series of shell commands
  77.  DumpCode        # write formatted CODE resources
  78.  DumpFile        # display contents of any file
  79.  DumpObj         # write formatted object file
  80.  Duplicate       # duplicate files and directories
  81.  Echo            # echo parameters
  82.  Eject           # eject volumes
  83.  Entab           # convert runs of spaces to tabs
  84.  Equal           # compare files and directories
  85.  Erase           # initialize volumes
  86.  Evaluate        # evaluate an expression
  87.  Execute         # execute command file in the current scope
  88.  Exists          # confirm the existence of a file or directory
  89.  Exit            # exit from a command file
  90.  Export          # make variables available to commands
  91.  FileDiv         # divide a file into several smaller files
  92.  Files           # list files and directories
  93.  Find            # find and select a text pattern
  94.  Flush           # flush the tools that the Shell has cached
  95.  For             # repeat commands once per parameter
  96.  Format          # set or display formatting options for a window
  97.  Get             # get information about a key word from a data file
  98.  GetErrorText    # display error messages based on message number
  99.  GetFileName     # display a Standard File dialog box
  100.  GetListItem     # display items for selection in a dialog box
  101.  Help.MPW        # write summary information
  102.  If              # conditional command execution
  103.  Lib             # combine object files into a library file
  104.  Line            # find line in the target window
  105.  Link            # link an application, tool, or resource
  106.  Loop            # repeat commands until Break
  107.  Make            # build up-to-date version of a program
  108.  MakeErrorFile   # create error message textfile
  109.  Mark            # assign a marker to a selection
  110.  Markers         # list markers
  111.  MatchIt         # semi-intelligent language sensitive bracket matcher
  112.  MergeBranch     # merge a branch revision onto the trunk
  113.  ModifyReadOnly  # enables a read-only Projector file to be edited
  114.  Mount           # mount volumes
  115.  MountProject    # mount projects
  116.  Move            # move files and directories
  117.  MoveWindow      # move window to h,v location
  118.  NameRevisions   # define a symbolic name
  119.  New             # open a new window
  120.  Newer           # compare modification dates of files
  121.  NewFolder       # create a new folder
  122.  NewProject      # create a new project
  123.  Open            # open file(s) in window(s)
  124.  OrphanFiles     # remove Projector information from a list of files
  125.  Parameters      # write parameters
  126.  Pascal          # Pascal compiler
  127.  PasMat          # Pascal programs formatter
  128.  PasRef          # Pascal cross-referencer
  129.  Paste           # replace selection with Clipboard contents
  130.  PerformReport   # generate a performance report
  131.  Position        # display current line position
  132.  Print           # print text files
  133.  PrintProff      # analyze a .proff file and print the results
  134.  ProcNames       # display Pascal procedure and function names
  135.  Project         # set or write the current project
  136.  ProjectInfo     # display information about a Project
  137.  Quit            # quit MPW
  138.  Quote           # echo parameters, quoting if needed
  139.  Rename          # rename files and directories
  140.  Replace         # replace the selection
  141.  Request         # request text from a dialog box
  142.  ResEqual        # compares the resources in two files
  143.  Revert          # revert window to previous saved state
  144.  Rez             # resource compiler
  145.  RezDet          # detect inconsistencies in resources
  146.  RotateWindows   # send active (frontmost) window to back
  147.  Save            # save specified windows
  148.  SaveOnClose     # set save behavior when closing windows
  149.  Search          # search files for pattern
  150.  Set             # define or write Shell variables
  151.  SetDirectory    # set the default directory
  152.  SetFile         # set file attributes
  153.  SetPrivilege    # set access privileges for directories on file servers
  154.  SetVersion      # maintain version and revision number
  155.  Shift           # renumber command file positional parameters
  156.  ShowSelection   # place the selection within an editor window
  157.  Shutdown        # power down or restart the machine
  158.  SizeWindow      # set a window's size
  159.  Sort            # sort or merge lines of text
  160.  StackWindows    # arrange windows diagonally
  161.  StreamEdit      # scriptable text editor
  162.  Target          # make a window the target window
  163.  TileWindows     # arrange windows in a tiled fashion
  164.  TransferCkid    # move Projector information from one file to another
  165.  Translate       # translate characters
  166.  Unalias         # remove aliases
  167.  Undo            # undo the last edit
  168.  Unexport        # remove variable definitions from the export list
  169.  Unmark          # remove a marker from a window
  170.  Unmount         # unmount volumes
  171.  UnmountProject  # unmount projects
  172.  Unset           # remove Shell variable definitions
  173.  UserVariables   # uses Commando to set all the user variables
  174.  Version         # print the version of the MPW Shell
  175.  VersionList     # print version info from files
  176.  Volumes         # list mounted volumes
  177.  WhereIs         # find the location of a file
  178.  Which           # determine which file the shell will execute
  179.  Windows         # list windows
  180.  ZoomWindow      # enlarge or reduce a window's size
  181.  
  182. æKY Help
  183. MPWHelp
  184.  
  185. æKL About411
  186. Characters
  187. Commands
  188. Expressions
  189. Patterns
  190. Projector
  191. Selections
  192. Shortcuts
  193. Variables
  194.  
  195. AddMenu
  196. AddPane
  197. Adjust
  198. Alert
  199. Alias
  200. Align
  201. Asm
  202. Backup
  203. Beep
  204. Begin
  205. Break
  206. BuildCommands
  207. BuildMenu
  208. BuildProgram
  209. C
  210. Canon
  211. Catenate
  212. CFront
  213. CheckIn
  214. CheckOut
  215. CheckOutDir
  216. Choose
  217. Clear
  218. Close
  219. CMarker
  220. Commando
  221. Compare
  222. CompareFiles
  223. CompareRevisions
  224. Confirm
  225. Continue
  226. Copy
  227. Count
  228. CPlus
  229. CreateMake
  230. Cut
  231. Date
  232. Delete
  233. DeleteMenu
  234. DeleteNames
  235. DeletePane
  236. DeleteRevisions
  237. DeRez
  238. Directory
  239. DirectoryMenu
  240. DoIt
  241. DumpCode
  242. DumpFile
  243. DumpObj
  244. Duplicate
  245. Echo
  246. Eject
  247. Entab
  248. Equal
  249. Erase
  250. Evaluate
  251. Execute
  252. Exists
  253. Exit
  254. Export
  255. FileDiv
  256. Files
  257. Find
  258. Flush
  259. For
  260. Format
  261. Get
  262. GetErrorText
  263. GetFileName
  264. GetListItem
  265. Help.MPW
  266. If
  267. Lib
  268. Line
  269. Link
  270. Loop
  271. Make
  272. MakeErrorFile
  273. Mark
  274. Markers
  275. MatchIt
  276. MergeBranch
  277. ModifyReadOnly
  278. Mount
  279. MountProject
  280. Move
  281. MoveWindow
  282. NameRevisions
  283. New
  284. Newer
  285. NewFolder
  286. NewProject
  287. Open
  288. OrphanFiles
  289. Parameters
  290. Pascal
  291. PasMat
  292. PasRef
  293. Paste
  294. PerformReport
  295. Position
  296. Print
  297. ProcNames
  298. Project
  299. ProjectInfo
  300. Quit
  301. Quote
  302. Rename
  303. Replace
  304. Request
  305. ResEqual
  306. Revert
  307. Rez
  308. RezDet
  309. RotateWindows
  310. Save
  311. SaveOnClose
  312. Search
  313. Set
  314. SetDirectory
  315. SetFile
  316. SetPrivilege
  317. SetVersion
  318. Shift
  319. ShowSelection
  320. Shutdown
  321. SizeWindow
  322. Sort
  323. StackWindows
  324. StreamEdit
  325. Target
  326. TileWindows
  327. TransferCkid
  328. Translate
  329. Unalias
  330. Undo
  331. Unexport
  332. Unmark
  333. Unmount
  334. UnmountProject
  335. Unset
  336. UserVariables
  337. Version
  338. VersionList
  339. Volumes
  340. WhereIs
  341. Which
  342. Windows
  343. ZoomWindow
  344. æKY Variables
  345. æC                  Variables defined by the MPW Shell:
  346.  
  347.  {Active}          full pathname of current active window
  348.  {Aliases}         list of all defined aliases
  349.  {Boot}            volume name of the boot disk
  350.  {Command}         full pathname of the last command executed
  351.  {MPW}             full pathname of the Macintosh Programmer's Workshop.
  352.  {ShellDirectory}  full pathname of the directory that contains the MPW Shell
  353.  {Status}          result of the last command executed (0 means successful)
  354.  {SystemFolder}    full pathname of the system folder
  355.  {Target}          full pathname of the target window
  356.  {User}            the current user name (initialized to the "Chooser" name)
  357.  {Windows}         list of current windows     
  358.  {Worksheet}       full pathname of the Worksheet window
  359.  
  360.  Variables used by the MPW Shell:
  361.  
  362.  {Commando}        name of the commando tool
  363.  {Commands}        list of directories to search for commands
  364.  {DirectoryPath}   list of common directories to speed changing directories
  365.  {Echo}            control the echoing of commands to diagnostic output
  366.  {Exit}            control script termination based on {Status}
  367.  {IgnoreCmdPeriod} control use of cmd-. during critical sections
  368.  {HideHelpKey}     deactivate "help" key on extended keyboard
  369.  {Test}            control execution of tools and applications
  370.  {AutoIndent}      auto indent setting used for new windows
  371.  {CaseSensitive}   control case sensitivity for searching
  372.  {Font}            font used for new windows
  373.  {FontSize}        font size used for new windows
  374.  {NewWindowRect}   window rectangle used for new windows (top,left,bottom,right)
  375.  {PrintOptions}    options used by the print menu commands
  376.  {SearchBackward}  control direction of searching
  377.  {SearchType}      control type of searching (literal/word/expression)
  378.  {SearchWrap}      control wrap-around search
  379.  {StackOptions}    options used by the Stack Windows menu command
  380.  {Tab}             tab size used for new windows
  381.  {TileOptions}     options used by the Tile Windows menu command
  382.  {WordSet}         set of characters that constitue a word
  383.  {ZoomWindowRect}  window rectangle used for a zoomed window (top,left,bottom,right)
  384.  
  385.  Variables automatically set before script execution:
  386.  
  387.  {0}               name of the currently executing script
  388.  {1}, {2}, … {n}   first, second, and nth parameter to the script
  389.  {#}               number of parameters
  390.  {Parameters}      equivalent to {1} {2} … {n}
  391.  {"Parameters"}    equivalent to "{1}" "{2}" … "{n}"
  392.  
  393.  Variables used for libraries and include files:
  394.  
  395.  {AIncludes}       directories to search for assemby-language include files        
  396.  {CIncludes}       directories to search for C include files
  397.  {CLibraries}      directory containing C library files
  398.  {Libraries}       directory containing shared library files
  399.  {PInterfaces}     directory containing Pascal interface files
  400.  {PLibraries}      directory containing Pascal library files
  401.  {RIncludes}       directory containing Rez include files
  402.  
  403. æKY Characters
  404. æC   The characters listed below have special meanings in the command language.
  405.  
  406.  
  407.  Space           Space separates words.
  408.  Tab             Tab also separates words.
  409.  
  410.  Return          Return separates commands.
  411.  ;               Semicolon also separates commands.
  412.  |               Pipe separates commands and pipes output to input.
  413.  &&              And separates commands, executing second if first succeeds.
  414.  ||              Or separates commands, executing second if first fails.
  415.  (…)             Parenthesis group commands.
  416.                  Parenthesis also group characters in filename patterns.
  417.  
  418.  #               Comment begins comments.
  419.  
  420.  ∂               Escape (Option-D) quotes the following character.
  421.  '…'             Single quote quotes all other characters.
  422.  "…"             Double quote quotes all characters except ∂, {, and `.
  423.  /…/             Slash quotes all characters except ∂, {, and `.
  424.  \…\             Backslash quotes all characters except ∂, {, and `.
  425.  
  426.  {…}             Braces denote variable substitution.
  427.  `…`             Backquotes denote command substitution.
  428.  
  429.  ?               Question mark matches any character in filename patterns.
  430.  ≈               Approximately (Option-X) matches any string in patterns.
  431.  […]             Brackets enclose character sets in filename patterns.
  432.  *               Star indicates zero or more repetitions in patterns.
  433.  +               Plus indicates one or more repetitions in patterns.
  434.  «…»             European quotes (Option-\ and Option-Shift-\) enclose
  435.                  repeat counts.
  436.  
  437.  <               Less-than indicates an input file specification.
  438.  >               Greater-than indicates an output file specification.
  439.  >>              Indicates appending to an output file specification.
  440.  ≥               Greater-than-or-equal indicates a diagnostic specification.
  441.  ≥≥              Indicates appending to a diagnostic file specification.
  442.  ∑               Capital sigma (option-w) indicates both an output file and
  443.                  diagnostic output file specification.
  444.  ∑∑              Indicates appending to the output and diagnostic file
  445.                  specification.
  446.  
  447.  …               Elipsis (Option-;) signals the Shell to use Commando
  448.  
  449. æKY Expressions
  450. æC  Expressions
  451.  
  452.  Numbers may be expressed in decimal, hexadecimal, octal, or
  453.  binary.  Any of the following formats may be used:
  454.  
  455.  [0-9]+          decimal number
  456.  0x[0-9a-f]+     hexadecimal number
  457.  $[0-9a-f]+      hexadecimal number
  458.  0[0-7]+         octal number
  459.  0b[01]+         binary number
  460.  
  461.  The operators listed below are used in expressions in the
  462.  Evaluate, If, Else If, Break, Continue, and Exit commands. 
  463.  
  464.  Alternate spellings of several operators are provided.
  465.  All of the operators are evaluated from left to right.
  466.  Operators with the highest precedence are listed first,
  467.  and operators in the same group have equal precedence.
  468.  
  469.  
  470.  (…)             expression grouping
  471.  
  472.  -               unary negation
  473.  ~               bitwise negation
  474.  !    NOT  ¬     logical NOT (¬ is Option-L)
  475.  
  476.  *               multiplication
  477.  ÷    DIV        division (÷ is Option-/)
  478.  %    MOD        modulus division
  479.  
  480.  +               addition
  481.  -               subtraction
  482.  
  483.  <<              shift left
  484.  >>              shift right
  485.  
  486.  <               less than
  487.  <=   ≤          less than or equal to (≤ is Option-<)
  488.  >               greater than
  489.  >=   ≥          greater than or equal to (≥ is Option->)
  490.  
  491.  ==              equal
  492.  !=   <>   ≠     not equal (≠ is Option-=)
  493.  =~              equal to a pattern
  494.  !~              not equal to a pattern
  495.  
  496.  &               bitwise AND
  497.  
  498.  ^               bitwise XOR
  499.  
  500.  |               bitwise OR
  501.  
  502.  &&   AND        logical AND
  503.  
  504.  ||   OR         logical OR
  505.  
  506. æKY Selections
  507. æC      Selections - selections specify a selection or insertion point
  508.  
  509.  §                    current selection (Option-6)
  510.  n                    line number n
  511.  !n                   line n lines after end of current selection
  512.  ¡n                   line n lines before start of selection (Option-1)
  513.  position             position (defined below)
  514.  markerName           selection marked by markerName
  515.  pattern              pattern  (defined below)
  516.  (selection)          selection grouping
  517.  selection:selection  both selections and everything in between
  518.  
  519. position - positions specify an insertion point
  520.  
  521.  •                    position before first character of file (Option-8)
  522.  ∞                    position after last character of file (Option-5)
  523.  Δselection           position before first character of selection (Option-J)
  524.  selectionΔ           position after last character of selection (Option-J)
  525.  selection!n          position n characters after selection
  526.  selection¡n          position n characters before selection (Option-!)
  527.  
  528. pattern - patterns specify characters to be matched
  529.  
  530.  /entireRE/           regular expression - search forward
  531.  \entireRE\           regular expression - search backward
  532.  
  533.  Help Patterns           # See "Help Patterns" for more information.
  534.  
  535. æKY Patterns
  536. æC  Patterns - Patterns specify characters to be matched
  537.  /entireRE/           regular expression - search forward
  538.  \entireRE\           regular expression - search backward
  539.  
  540. entireRE
  541.  
  542.  •RE                  regular expression at beginning of line (Option-8)
  543.  RE∞                  regular expression at end of line (Option-5)
  544.  RE                   regular expression
  545.  
  546. RE
  547.  
  548.  simpleExpr           simple regular expression - defined below
  549.  (RE)®digit           tagged RE - refer to match as ®digit (Option-R)
  550.  'string'             literal - no characters within '…' are special
  551.  "string"             literal - only ∂, {, and ` are special within "…"
  552.  RE1RE2               regular expression RE1 followed by RE2
  553.  
  554. simpleExpr
  555.  
  556.  (RE)                 regular expression grouping
  557.  charExpr             single character regular expression - defined below
  558.  simpleExpr*          simple expression zero or more times
  559.  simpleExpr+          simple expression one of more times
  560.  simpleExpr«n»        simple expression n times (Option-\, Option-Shift-\)
  561.  simpleExpr«n,»       simple expression at least n times
  562.  simpleExpr«n1,n2»    simple expression at least n1, at most n2 times
  563.  
  564. charExpr
  565.  
  566.  character            character (unless it has special meaning)
  567.  ∂character           character - defeats any special meaning (Option-D)
  568.  ?                    any character except Return
  569.  ≈                    zero or more characters, except Return (Option-X)
  570.  [charList]           any character in the list
  571.  [¬charList]          any character not in the list (Option-L)
  572.  
  573. charList
  574.  
  575.  [                    [ first in the list represents itself
  576.  ]                    ] first in the list represents itself
  577.  -                    - first in the list represents itself
  578.  character            character
  579.  charList character   list of characters
  580.  character-character  character range (e.g. A-Z)
  581.  
  582. æKY ShortCuts
  583. æC   The following is a list of MPW Shell shortcuts:
  584.  
  585.     Double click        select word
  586.     Triple click        select line
  587.     Double Clicking on any of the characters (,),[,],{,},',",/,\,` will select
  588.     everything between the character and its mate.
  589.  
  590.     UpArrow             move insertion point one line above current position
  591.     DownArrow           move insertion point one line below current position
  592.     RightArrow          move insertion point one character to the right
  593.     LeftArrow           move insertion point one character to the left
  594.  
  595.  
  596.     Opt-LeftArrow       move insertion point one word to the left
  597.     Opt-RightArrow      move insertion point one word to the right
  598.     Cmd-UpArrow         move insertion point up one screen size
  599.     Cmd-DownArrow       move insertion point down one screen size
  600.     Cmd-RightArrow      move insertion point to end of current line
  601.     Cmd-LeftArrow       move insertion point to beginning of current line
  602.     Cmd-Opt-UpArrow     move insertion point to beginning of file
  603.     Cmd-Opt-DownArrow   move insertion point to end of file
  604.  
  605.     For the above eight shortcuts, use of the Shift key changes the action
  606.     from "move" to "extend selection."  E.g., Cmd-Shift-Opt RightArrow means
  607.     "extend selection to end of line."
  608.  
  609.     Delete              delete character to the left
  610.     Clear               delete character to the right
  611.     Opt-Delete          delete word to the left
  612.     Opt-Clear           delete word to the right
  613.     Cmd-Delete          delete from current position to end of line
  614.     Cmd-Clear           delete from current position to beginning of line
  615.     Cmd-Opt-Delete      delete from current position to end of file
  616.     Cmd-OptClear        delete from current position to beginnning of file
  617.  
  618.     Searching shortcuts
  619.         Cmd-Shift-G     reverse the direction of "Find Same"
  620.         Cmd-Shift-H     reverse the direction of "Find Selection"
  621.         Cmd-Shift-T     reverse the direction of "Replace Same"
  622.         Holding down Shift while selecting OK will reverse the direction
  623.             of "Find" and "Find and Replace"
  624.  
  625.     Holding down Option while selecting "Tile Windows" or "Stack Windows"
  626.         will include the worksheet in the tiling or stacking
  627.     Holding down Option while pressing Return will disable auto-indent
  628.         for that line.
  629.     Holding down Option while pressing Enter will invoke Commando on that
  630.         command line.
  631.  
  632.     In Dialogs without an EditText item
  633.         Y              Yes
  634.         N              No
  635.         CMD .          Cancel
  636.         ESC            Cancel
  637.  
  638. æKY Profiling
  639. æC   Proff and PrintProff are a pair of components that provide profiling and
  640. performance monitoring for programs compiled from MPW C, C++, Pascal, and
  641. Object Pascal.  Profiling, which occurs while your program executes, is
  642. the dynamic recording for every routine call, of the identity of the called
  643. routine and the point from which it was called, e.g., statement n in procedure
  644. foo. Performance monitoring in the context of profiling is the recording of
  645. the time spent in each such routine.
  646.  
  647. The Proff component is actually a library:
  648.  
  649.      {MPW}Libraries:Libraries:Proff.o
  650.  
  651. The PrintProff component is a tool, to be found in {MPW}Tools:.  PrintProff
  652. produces a human-readable output from the data file generated by Proff.o.  In 
  653. order to obtain profiling data, compile and link as follows:
  654.  
  655. For C, C++, and Object Pascal, compile with the option "-sym full". Then, for
  656. C and C++, either apply the option "-trace on", or bracket the code to
  657. be monitored with "#pragma trace on" and "#pragma trace off".  For Object Pascal,
  658. bracket the code to be monitored with "{$D++}" and "{$D--}".  Link with the 
  659. following command line:
  660.  
  661.      Link -sn ProffSeg=main -sym full …
  662.  
  663. In order to monitor code that executes when A5 does not belong to the target
  664. program, e.g. ROM patch code, do C (or C++) compilations with the option "-b3"
  665. to force PC-relative branches and jumps.  In Object Pascal, this is the default.
  666. Link with the following:
  667.  
  668.      Link -sn ProffSet=<residentSeg> -sym full …
  669.  
  670. The file containing the profiling data will have the target (application) name
  671. with .Proff appended as a suffix.  Important: When profiling an MPW tool, the
  672. generated name will be "MPW Shell.Proff".  This should be changed manually
  673. to "<toolname>.Proff" before running PrintProff.
  674.  
  675.                              See also 
  676.  
  677. PrintProff
  678.  
  679. æKY Projector
  680. æC   Projector is a collection of built–in MPW commands and windows that
  681.  help programmers (both individuals and teams) control and account for
  682.  changes to all the files (documentation, source, applications etc.)
  683.  associated with a software project.
  684.  
  685.  Here is a brief summary of the commands (the CheckIn, CheckOut, and
  686.  NewProject commands also have windows that can be opened using the
  687.  "-w" option to the respective command):
  688.  
  689.  CheckIn          # check a file into a project
  690.  CheckOut         # check a file out from a project
  691.  CheckOutDir      # specify the directory where checked out files will placed
  692.  CompareRevisions # compare two revisions of a file in a project
  693.  DeleteNames      # delete user-defined symbolic names
  694.  DeleteRevisions  # delete previous revisions of files in a project
  695.  MergeBranch      # merge a branch revision onto the trunk
  696.  ModifyReadOnly   # enables a read-only Projector file to be edited
  697.  MountProject     # mount projects
  698.  NameRevisions    # define a symbolic name
  699.  NewProject       # create a new project
  700.  OrphanFiles      # remove Projector information from a list of files
  701.  Project          # set or write the current project
  702.  ProjectInfo      # display information about a Project
  703.  TransferCkid     # move Projector information from one file to another
  704.  UnmountProject   # unmount projects
  705.  
  706.                              Examples
  707.  
  708.   The command
  709.  
  710.   Project
  711.  
  712.   causes the current project name to be written to standard output.
  713.   To change the current project to OurProject, use
  714.  
  715.   Project OurProject
  716.  
  717.  
  718.                              See also 
  719.  
  720.   NewProject, MountProject.
  721.  
  722.  
  723. æKY About411
  724. æC         
  725. About "411"
  726. "411" provides a way for Macintosh developers to achieve rapid retrieval of software 
  727. development information while using Apple's MPW development system. The access can be 
  728. via menus and command keys or from command line entries.  The software development 
  729. information includes language-specific Inside Macintosh documentation, Tech Notes, 
  730. MPW command descriptions and Resource information.  In addition a facility for automatic 
  731. insertion of Toolbox call templates is provided.
  732.  
  733. "411" can also be customized and extended and new information can be added.  The help 
  734. files of "411" may be either local or on a shared file server.
  735.  
  736. Setting up "411"
  737.  
  738. "411" consists of a installation instructions file (Read Me First), a special UserStartup 
  739. script (UserStartup•Help), an installation script (Install411), and a set of help files 
  740. along with their .index and .wIndex files. It makes use of a new MPW tool, Get, which was  
  741. written to support "411" but can be used independently.  The "411" folder holds the help files,
  742. their index and cross reference index files and a "Tools" folder.  
  743.  
  744. An important decision to make in setting up "411" is whether to place the "411" Help files 
  745. on a server or on your local hard disk.  Since these files are large (over 16 Meg total) some 
  746. thought should go into deciding which files to use and whether to transfer them to your 
  747. hard disk or, if you are connected to a network, to a file server.  The most obvious candidate
  748. for removal is either CIncludesHelp or PInterfacesHelp.  If you are not developing in 
  749. both C and Pascal, one of them will probably not be needed. Less obvious, but more significant
  750. canidates for removal are the .wIndex files.  These files are not required but significantly 
  751. speeds up the cross reference search done when selecting the 'Search' menu item.  Placing the
  752. help files on a local hard disk will provide better access speed but will use significant disk
  753. space.  If you have access to a file server and several persons want to access "411" Help, it
  754. may be best to move the "411" folder to the file server.
  755.  
  756. Set up "411" by writing the following two commands to your MPW WorkSheet and 
  757. executing them:
  758.  
  759. <rls>:Install411 <info>
  760. Execute "{ShellDirectory}"UserStartup•Help
  761.  
  762. where <rls> denotes the path to the "411" files on the release medium and <info> denotes 
  763. the volume on which the user wishes the "411" Help files to reside.  If <info> is omitted, 
  764. the installation will be to the volume that begins the path <rls>.  (In this latter case, the 
  765. data files are not duplicated because they are already residing in the desired place.)
  766. For example, if "411" were to be released in a folder named 411Stuff on a CD named MPW 
  767. 3.2 Release, and the user wanted "411" to be installed on a volume named HelpMe, then 
  768. the commands to be executed would read:
  769.  
  770. 'MPW 3.2 Release:411Stuff:Install411' HelpMe:
  771. Execute "{ShellDirectory}"UserStartup•Help
  772.  
  773. The effect of the first of the above commands is to create the folder HelpMe:411: and to 
  774. copy to it all of the "411" files.  It then, additionally, copies the new Get tool to the 
  775. user’s MPW Tools folder, copies UserStartup•Help to the MPW folder, and creates a folder 
  776. called Help Folder in the MPW folder.  This latter folder contains at this time a file called 
  777. Help_Folder whose contents is the single line: HelpMe:411:, i.e. the name of the folder 
  778. containing the "411" information.  The effect of the second of the above commands is to 
  779. add the "411" menu to the menu bar, and to add one more file to the Help Folder,  a file 
  780. called Help_Files which  contains the names of all of the "411" data files in the order in 
  781. which they will be interrogated, e.g.:
  782.  
  783. HelpMe:411:CIncludesHelp
  784. HelpMe:411:InsideMacintoshHelp
  785. HelpMe:411:MPWHelp
  786. HelpMe:411:PInterfacesHelp
  787. HelpMe:411:ResourcesHelp
  788. HelpMe:411:TechNotesHelp
  789.  
  790. NOTE:  Because the cross reference (.wIndex) files are so large they are not installed
  791. automatically.  If you want to use these files just drag their icon to the desired folder.
  792.  
  793. Using the "411" Help menu
  794.  
  795. "411" works only from within the MPW development environment.  When "411" is properly 
  796. set up, there should be a 411 menu on the MPW menu bar.  If there has been no 
  797. change to the UserStartup•Help script, the Help menu looks like this:
  798.  
  799.  
  800.  411 Menu
  801.     
  802.         Directory  Build  411                   
  803.        ________________________________________________
  804.           HD:MPW:Worksheet       |  Contents          |
  805.        __________________________|  Look up    CMD-E  |
  806.                                  |  Template   CMD-1  |
  807.                                  |  Show Keys         |
  808.                                  |  Search            |
  809.                                  |____________________|
  810.                                  |  Set First File ...|
  811.                                  |  Set 411 Files ...|
  812.                                  |  Edit 411 Files ...|
  813.                                  |____________________|
  814.                                  |  About 411 ...     |
  815.                                  |____________________|
  816.  
  817. The menu items Look up and Template search all of the files listed in Help_Files; 
  818. the items Contents, Show Keys, and Search look only at the first file in the 
  819. Help_Files list.  This first file is known as the currently selected file.  It can be changed 
  820. by using the Set First File menu item.
  821.  
  822.  
  823. Contents
  824.  
  825. This menu item lets you see a list of the Help file’s table of contents.  For example, if the 
  826. CIncludesHelp file is the currently selected Help file, then selecting the "Contents" menu 
  827. item, causes a list of the ToolBox managers to appear in the Help window.
  828. ————————————————————————————————————————————————————————————————————————
  829. HelpMe:411:CIncludesHelp           Look up… "Help" 
  830. ————————————————————————————————————————————————————————————————————————
  831. Appletalk.h       FixMath.h         Palettes.h     Serial.h
  832. Controls.h        Fonts.h           Perf.h         ShutDown.h
  833. CursorCtl.h       Globals           Picker.h       Slots.h
  834. Desk.h            Graf3D.h          Printing.h     Sound.h
  835. Deskbus.h         HyperXCmd.h       Quickdraw.h    Start.h
  836. ...
  837.  
  838. Note that you can obtain the same information by selecting the key word "Help" (or the 
  839. name of the help file, e.g. CIncludesHelp) and then selecting the Look up menu item.  
  840.  
  841.  
  842. Look up  (Command-E)
  843.  
  844. This menu item lets you look up information stored in the help files; the search starts with 
  845. the currently selected file (See Set First File...).   For example, if you choose (see 2 
  846. below) the word FindWindow and then select the Look up menu item (or type Command-E) the 
  847. following information will appear in the Help window:
  848.  
  849. ------------------------------------------------------------------------
  850. HelpMe:411:CIncludesHelp     Look up… "findwindow" 
  851. ------------------------------------------------------------------------
  852. short findwindow(Point *thePoint,WindowPtr *theWindow);
  853. Type: Function
  854. File {CIncludes}Windows.h
  855. Trap Number A92C
  856. InsideMacintosh Reference: FindWindow function I-287, P-35, 114, 170 
  857. FindWindow procedure  V-208
  858. [Macintosh Plus, Macintosh SE, Macintosh II]
  859.  
  860. When a mouse-down event occurs, the application should call FindWindow 
  861. with thePt equal to the point where the mouse button was pressed (in 
  862. global coordinates, as
  863. ...
  864. Thus, to get help for a given key word:
  865.  
  866. 1) Choose the Help file you want information from by using the Set First File... menu 
  867. item to make the desired file the first file (currently selected file) in the help file list.  
  868. (Skip this step if the help file is already selected, or if the order of search does not 
  869. matter.)
  870.  
  871. 2) Click on a word in the active window.  You may want to type in the word you want to 
  872. look up instead.  If the item is just one word, it will be automatically selected if the 
  873. insertion point is adjacent to or within the word.  Only if a multiple word item is to be 
  874. looked up is it necessary to do a manual selection of the entire item.  (Note:  the means 
  875. you don’t have to double-click.  Also you don’t have to type the entire word, just 
  876. enough letters to allow 411 to distinguish between the word you want and any other in 
  877. the current Help file.)  
  878.  
  879. 3) Select the menu item Look up or type Command-E.  This triggers a search through the help 
  880. files, in the order in which they are listed,  looking for the selected key word.  If the 
  881. search is successful then a window named Help (a file in the MPW directory) is opened 
  882. and the information associated with the key word is displayed, along with an indication 
  883. of the file in which the key word was found.
  884.  
  885. Remember, the Look up menu item simply looks for the current selection in the active 
  886. window.
  887.  
  888. Since numbers are keywords only in TechNotesHelp, selecting a number will retrieve the 
  889. Macintosh Technical note of that number.
  890.  
  891. The header, which is placed above the "Contents" information, shows the help file that was 
  892. used.  To the right of the file name is a message indicating the key word on which the 
  893. search was made.  A mark is set to this (selected) key word in the file Help to aid the user 
  894. in subsequent scanning of Help for previously gathered information.  
  895.  
  896. A slight modification of UserStartup•Help causes the header to list all the "411" files in 
  897. the order in which they are searched, with  the words on the right (Look up…) printed on 
  898. the line bearing the name of the file in which the item was actually found.  (See 
  899. Customizing "411" below.)
  900.  
  901.  
  902. Template  (Command-1)
  903.  
  904. This menu item lets you replace a toolbox function call such as FindWindow with the 
  905. template for that function.  For example if you were to select "FindWindow" and choose 
  906. the 'Template' menu item (or type Command-1), then your "FindWindow" selection in the Active 
  907. window would be replaced by:
  908.  
  909. short myVariable = findwindow((Point *)thePoint,(WindowPtr *)theWindow);
  910.  
  911. Both C and Pascal templates are available.  Use Set First File... on the 411 menu to 
  912. choose a language by selecting either CIncludesHelp or PInterfacesHelp.
  913.  
  914.  
  915. Show keys…
  916.  
  917. This menu item lets you list all of the keys in the currently selected help file which begin 
  918. with the word you have selected in the Request dialog.  For example, selecting this menu 
  919. and then typing the two letters "fs" when CIncludesHelp is your current (first listed) help 
  920. file, produces a list of all of the HFS calls that begin with "FS", i.e. FSClose, ...
  921.  
  922.  
  923. Search…
  924.  
  925. This menu item lets you search the currently selected help file for all occurrences of the 
  926. word you have selected.  The result is a list of names (keys) whose data records contain the 
  927. word.  On a large Help file, e.g. CIncludesHelp, this can take a minute or more.  Only the 
  928. current  (first listed) help file is searched even if no data record containing the word is 
  929. found.  If your help folder contains a cross reference (.wIndex) file for the Help file the
  930. time to search a file is reduced to several seconds.
  931.  
  932.  
  933. Set First File…
  934.  
  935. This menu item lets you choose a help file to be the currently selected file.  A dialog window 
  936. shows a list of all help files, and you are invited to make a selection.   The selected file 
  937. then becomes the first file in the list that appears in the file Help_Files.  It is then known 
  938. as the currently selected file, and, until you again reorder the list, is the initial target 
  939. of all Look up, Template, and Contents requests, and the only file used by Show Keys and 
  940. Search.  The Help window opens, displaying the contents list of the selected file.  
  941.  
  942. Set 411 Files…
  943.  
  944. This menu item presents a standard file dialog from which to locate a help folder.  If a help 
  945. folder is selected then all the files in the folder that end in the word help are placed in 
  946. the list of files to search (in Help_Files).  Note that this will remove any existing files 
  947. from the list..
  948.  
  949.  
  950. Edit 411 Files
  951.  
  952. This menu item open the Help_Files window, which contains a list of all the help files 
  953. that "411" knows about.  The list may be edited and then saved.  Note that each line 
  954. specifies a path to a single help file.
  955.  
  956.  
  957. About 411…
  958.  
  959. This menu item displays the credits and then does a lookup in the MPWHelp file for the 
  960. key "About411".
  961.  
  962.  
  963. Customizing "411"
  964.  
  965. There are several ways in which "411" can be customized by modifying the 
  966. UserStartup•Help script:
  967.  
  968. •   If you are using a file server and want the script to call the MPW Choose tool to mount 
  969.     the file server when MPW is launched, set the script variables Help_Server and 
  970.     Guest. Set the former to the desired zone:server:volume pathname, and set the 
  971.     latter to 1 if want to log onto the server as an AppleShare "guest.".  Note: This requires 
  972.     the Choose tool from MPW 3.2 or later.
  973.  
  974. •   If you wish to add or change command keys in the menu, simply edit the AddMenu 
  975.     commands in the UserStartup•Help script. For example, the line
  976.  
  977.     AddMenu 411 "Look up/1" 
  978.  
  979.     in the script could be changed to:
  980.  
  981.     AddMenu 411 "Look up/7" 
  982.  
  983.     to change the function key to Command-7.  Alternatively,
  984.  
  985.     AddMenu 411 "Look up" 
  986.     removes the function key associated with the Look up menu item entirely.
  987.  
  988. •   If you wish to change the name of the "411" menu, modify the argument of the AddMenu 
  989.     command.  For example, you can change the menu name "411" to "MyMenu" by 
  990.     changing all occurrences of AddMenu 411... to AddMenu MyMenu... in the 
  991.     UserStartup•Help script.
  992.  
  993. •   If you wish all help files to be listed in the header, change the script so that it sets 
  994.     the value of the variable headerStyle to -h (the default is -h2).
  995.  
  996.  
  997. Using the Get Tool
  998.  
  999. The retrieval of information through the "411" Help menu is based upon calls to the MPW 
  1000. Get tool.  The calls that are used by "411" can be seen in the file UserStartup•Help.  If 
  1001. you choose, you may instead call the Get tool directly or from your own script.  
  1002.  
  1003. (See the section on Get in the MPW 3.2 B1 Tools/Scripts Release Notes.)  
  1004.  
  1005.  
  1006. Adding your own help to "411"
  1007.  
  1008. Help files used by the Get tool are ordinary MPW Shell document files whose names end 
  1009. with "Help" and that have an internal organization which is recognized by the Get tool.  
  1010. The requirements are that a Help file consists of a set of records, each record in turn 
  1011. consisting of one or more fields.  Each record must start with the field tag æKY ("æ" is 
  1012. option-')  followed by one or more words separated by carriage returns.  The search of the 
  1013. help file is made on the key words.  All other fields are various categories of information to
  1014. be retrieved.  Field tags must be the first item on a line, and are separated from the 
  1015. following material by one or more spaces.  Field tags are case sensitive.  Each field is 
  1016. terminated by the appearance of a new field tag.  The record is terminated by the next æKY tag
  1017. (or end of file).
  1018.  
  1019. Example:
  1020.  
  1021.  
  1022.  æKY Key1
  1023.      Key2
  1024.      Key3
  1025.  æC This is a comment
  1026.  
  1027. The various tags other than æKY are used to put the information to be retrieved into 
  1028. categories.  The most neutral of them is æC, which is used for general textual matter.  These 
  1029. tags in some cases modify the behavior of Get.  For example, the tag æDT, which is used 
  1030. for templates, precedes data which will be retrieved if and only if Get is called with the -t 
  1031. option.  This is used in the implementation of the "template" menu item.  Other tags cause 
  1032. some boiler plate to be emitted prior to the text in the data base.  For example, the tag æRI 
  1033. is used for fields that contain chapter and page references to Inside Macintosh.  The text 
  1034. following the field tag will have inserted before it the cosmetic text:  "InsideMacintosh 
  1035. Reference:".  
  1036.  
  1037. Field Tag Codes:
  1038.  
  1039.  æKY     Key word or set of key words separated by carriage returns.  This field denotes
  1040.          the beginning of  a "411" record and the words in this field are the record's
  1041.          names, i.e. the words used as keys for retrieval of the record’s data.
  1042.  
  1043.  æKL     Key word List .  This is typically used in conjunction with the key "Help" to
  1044.          list, as a table of contents, all of the key words in the file.
  1045.  
  1046.  æFa     File name of Assembler include file.
  1047.  
  1048.  æFc     File name of C header file.
  1049.  
  1050.  æFp     File name of Pascal Interface file.
  1051.  
  1052.  æF      Used for the names of files which are not interfaces.
  1053.  
  1054.  æT      Type of the item:  function/structure/constant/etc. 
  1055.  
  1056.  æD      Formal declaration of the item: function, procedure, or structure. 
  1057.  
  1058.  æDT     A template for calls of procedures and functions.
  1059.  
  1060.  æC      Commentary.  This is general textual information, generally lengthy compared
  1061.         to that associated with the other tags.
  1062.  
  1063.  æR      Reference to…  Used for references other than to Tech Notes and Inside
  1064.         Macintosh.
  1065.  
  1066.  æRI     Reference to Inside Macintosh.  This is usually a chapter and page reference.
  1067.  
  1068.  æRT     Reference to Tech Note.  This is usually a reference by number.
  1069.  
  1070.  æTN     Trap Number.  This is used to annotate function that are in-line trap calls.
  1071.  
  1072.  æMM     Routine may move or purge memory.  This tag cause issuance of the preceding
  1073.         warning.
  1074.  
  1075.  
  1076. When the Get tool is executed, it first retrieves the byte offset of a key word from the index 
  1077. file, positions to the æKY line in the help file, and then reads all of the following lines 
  1078. until another æKY typed line is encountered.  Get then outputs the record, after first 
  1079. removing the field tag codes from each field.  Therefore, if the contents of a help file are
  1080. altered in any way, it is necessary that the index be rebuilt.  This is handled automatically
  1081. by the Get tool, which puts up a dialog stating that the index needs to be rebuilt and
  1082. requesting permission.  In ordinary circumstances, this dialog should be answered 
  1083. affirmatively.
  1084.  
  1085.  
  1086. About the files in your "411" folder
  1087.  
  1088. The "411" folder contains the following files:
  1089. :411:
  1090.        Install411                   # the "411 installation script.
  1091.        CIncludesHelp                # the CIncludesHelp data file. 
  1092.        CIncludesHelp.index          # the CIncludesHelp index file. 
  1093.        CIncludesHelp.windex         # the CIncludesHelp cross reference index file. 
  1094.        InsideMacintoshHelp          # Vols. 1-6 data file.
  1095.        InsideMacintoshHelp.index    # Vols. 1-6 index file.
  1096.        InsideMacintoshHelp.windex   # Vols. 1-6 cross reference index file.
  1097.        MPWHelp                      # the MPWHelp data file.
  1098.        MPWHelp.index                # the MPWHelp index file.
  1099.        MPWHelp.windex               # the MPWHelp cross reference index file.
  1100.        PInterfacesHelp              # the PInterfacesHelp data file.
  1101.        PInterfacesHelp.index        # the PInterfacesHelp index file.
  1102.        PInterfacesHelp.windex       # the PInterfacesHelp cross reference file.
  1103.        ResourcesHelp                # the ResourcesHelp data file.
  1104.        ResourcesHelp.index          # the ResourcesHelp index file.
  1105.        ResourcesHelp.windex         # the ResourcesHelp cross reference index file.
  1106.        TechNotesHelp                # the TechNotesHelp data file.
  1107.        TechNotesHelp.index          # the TechNotesHelp index file.
  1108.        TechNotesHelp.windex         # the TechNotesHelp cross reference index file.
  1109.                           
  1110.  
  1111. :411:Tools:
  1112.        Get                          # the Get MPW tool - used to
  1113.                                     # look up help info.
  1114.        UserStartup•Help             # the "411" UserStartup script.
  1115.  
  1116.  
  1117. Files created by "411"
  1118.  
  1119. The following files are created by the UserStartup•Help script, either at startup time, or 
  1120. as the result of execution of menu items created by the script.  They all reside in the folder 
  1121. "{MPW}Help Folder:"
  1122.  
  1123.  
  1124.  
  1125.          Help                      # your "411" Help window.
  1126.          Help_Folder               # contains the "411" path name 
  1127.                                    # (path name to help data and 
  1128.                                    # index files) 
  1129.          Help_Files                # contains the list of all help  
  1130.                                    # files (full file names including path)
  1131.          Help_Temp                 # temporary file used by the "411" menu
  1132.  
  1133.  
  1134.  
  1135. æKY AddPane
  1136. æC                         AddPane-- split the window into panes
  1137.  
  1138. AddPane[-p paneSpec] [-h ySplit | -v xSplit] [window]
  1139.      -p paneSpec           # choose a pane to split
  1140.      -y ySplit             # horizontal split at ySplit pixels from top
  1141.      -x xSplit             # vertical split at xSplit pixels from left
  1142.  
  1143.       Note: paneSpec is an alternating catenation of strings of the 
  1144.       form cm and rn, where m is a column ordinal and n is a row ordinal.
  1145.  
  1146.  
  1147.  
  1148. æKY AddMenu
  1149. æC                      AddMenu -- add a menu item
  1150.  
  1151. AddMenu [menu [item [command…]]]  > menuList
  1152.  
  1153. Status codes returned:
  1154.   0    No errors.
  1155.   1    Syntax error.
  1156.   2    An item can’t be redefined.
  1157.   3    System error.
  1158.  
  1159.                            Description
  1160.  
  1161.   Associates a list of commands with the menu item itemName in the
  1162.   menu menuName. If the menu menuName already exists, the new item
  1163.   is appended to the bottom of that menu. If the menu menuName doesn’t
  1164.   already exist, a new menu is appended to the menu bar, and the new
  1165.   item is appended to that menu. When the new menu item is selected,
  1166.   its associated command list is executed just as though the command
  1167.   text had been selected and executed in the active window.
  1168.  
  1169.     • Note: The command text that you specify for an AddMenu item
  1170.     is processed twice—once when you execute the AddMenu command
  1171.     itself, and again whenever you subsequently select the new menu
  1172.     item. This means that you must be careful to quote items so that
  1173.     they are processed at the proper time. See the "Examples" section
  1174.     below.
  1175.  
  1176.   You can also use AddMenu to display information for existing user-defined
  1177.   menus by omitting parameters:
  1178.  
  1179.     • If command is not specified, the command list associated with
  1180.     itemName is written to standard output.
  1181.  
  1182.     • If itemName and command are both omitted, a list of all user-defined
  1183.     items for menuName is written to standard output.
  1184.  
  1185.     • If no parameters are specified, a list of all user-defined
  1186.     items is written to standard output.
  1187.  
  1188.   (This output is in the form of AddMenu commands.)
  1189.  
  1190.   You can also use AddMenu to change the command list or markings associated
  1191.   with a particular itemName. If both menuName and itemName already
  1192.   exist, the command list associated with itemName will be changed
  1193.   to command. Also, any marking or styles associated with itemName
  1194.   will be changed. The position of itemName in menuName will not be
  1195.   affected.
  1196.  
  1197.   You can define keyboard equivalents, character styles, and other
  1198.   features for your new menu commands—itemName can contain any of the
  1199.   metacharacters that are used with the AppendMenu( ) procedure documented
  1200.   in the MPW chapter entitled "Menu Manager" of Inside Macintosh:
  1201.  
  1202.   /char        Assign the keyboard equivalent Command-char.
  1203.  
  1204.   !char        Place char to the left of the menu item.
  1205.  
  1206.   ^n           Item has an icon, where n is the icon number. See Inside 
  1207.                Macintosh.
  1208.  
  1209.   (            Item is disabled (dimmed).
  1210.  
  1211.   <style       Item has a special character style; this style can be any
  1212.                of the following capital letters:
  1213.  
  1214.                B Bold
  1215.  
  1216.                I Italic
  1217.  
  1218.                U Underline
  1219.  
  1220.                O Outline
  1221.  
  1222.                S Shadow
  1223.  
  1224.   Multiple styles may be specified by preceding each with "<". Be sure
  1225.   to quote menu items containing these special characters. (See the
  1226.   "Examples" section below.)
  1227.  
  1228.     • Note: Semicolons ( ; ) cannot be used within an itemName.
  1229.  
  1230.   Menu items can’t be appended to the Window, Mark, or Apple menus.
  1231.  
  1232.  
  1233.                             Examples
  1234.  
  1235.   AddMenu
  1236.  
  1237.   Lists all user-defined menu items.
  1238.  
  1239.   AddMenu Extras "TimeStamp//P" 'Echo `Date`'
  1240.  
  1241.   Adds an "Extras" menu with a "TimeStamp" item, which writes the current
  1242.   time and date to the active window. This item has the Command-key
  1243.   equivalent Command-P.
  1244.  
  1245.   AddMenu File 'Format<B' 'Erase 1'
  1246.  
  1247.   Adds a "Format" item to the File menu (as discussed under the Erase
  1248.   command) and makes the item bold.
  1249.  
  1250.   AddMenu Find Top 'Find • "{Active}"'
  1251.  
  1252.   Adds the menu item "Top" to the Find menu, and defines it as the
  1253.   Find command enclosed in single quotation marks. This command places
  1254.   the insertion point at the beginning of the active window.
  1255.  
  1256.   Note: The following attempt to do the same thing will not work:
  1257.  
  1258.   AddMenu Find Top "Find • {Active}"
  1259.  
  1260.   This command won’t work because the {Active} variable will be expanded
  1261.   when the menu is added. (It should be expanded when the menu item
  1262.   is executed.) In the first (correct) example, the single quotes defeat
  1263.   variable expansion when the AddMenu command is executed; they are
  1264.   then stripped before the item is actually added. The double quotation
  1265.   marks remain, in case the pathname of the active window happens to
  1266.   contain any special characters.
  1267.  
  1268.   You may want to add some or all of the following commands to your
  1269.   UserStartup file:
  1270.  
  1271.   AddMenu Find '(-' ''
  1272.  
  1273.   AddMenu Find 'Top/6' 'Find • "{Active}"'
  1274.  
  1275.   AddMenu Find 'Bottom/5' 'Find ∞ "{Active}"'
  1276.  
  1277.   These commands create several new items in the Find menu. The first
  1278.   is a disabled separator that creates a new section at the bottom
  1279.   of the menu. The Top and Bottom items position the insertion point
  1280.   at the top and bottom of the active window. Both menu items have
  1281.   Command-key equivalents.
  1282.  
  1283.   AddMenu Directory 'Work' 'Directory HD:MPW:Work'
  1284.  
  1285.   AddMenu Directory 'Work!•' 'Directory HD:MPW:Work'
  1286.  
  1287.   The first command creates a command to move to the directory HD:MPW:Work.
  1288.   The second command marks the Work item with a bullet without changing
  1289.   the position of the item in the menu.
  1290.  
  1291.                             See also 
  1292.  
  1293.    DeleteMenu command.
  1294.  
  1295.   "Quoting Special Characters," "How Commands Are Interpreted," and
  1296.   "Defining Your Own Menu Commands" in Chapter 5.
  1297.  
  1298.   "Creating a Menu in Your Program" in chapter "Menu Manager" of Inside
  1299.   Macintosh.
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305. æKY Adjust
  1306. æC                        Adjust -- adjust lines
  1307.  
  1308. Adjust [-c count] [-l spaces] selection [window]
  1309.  
  1310.  -c count                # repeat the Adjust count times
  1311.  -l spaces               # shift lines by "spaces" spaces
  1312.  
  1313. Status codes returned:
  1314.   0    At least one instance of the selection was found.
  1315.   1    Syntax error.
  1316.   2    Another error.
  1317.  
  1318.                            Description
  1319.  
  1320.   Finds and selects the given selection and shifts all lines within
  1321.   the selection to the right by one tab, without changing the indentation.
  1322.  
  1323.   If a count is specified, count instances of selection are affected.
  1324.   The -l option lets you move lines by any number of spaces to the
  1325.   left or right.
  1326.  
  1327.   If you specify the window parameter, the command operates on window.
  1328.   It’s an error to specify a window that doesn’t exist. If no window
  1329.   is specified, the command operates on the target window (the second
  1330.   window from the front).
  1331.  
  1332.  
  1333.                             Examples
  1334.  
  1335.   Adjust -l 4 §
  1336.  
  1337.   Shifts the lines containing the target selection to the right by
  1338.   four spaces.
  1339.  
  1340.   Adjust -l -8 /if/Δ:Δ/else/
  1341.  
  1342.   Selects everything after the next "if" and before the following "else",
  1343.   and shifts all lines within the selection to the left by eight spaces.
  1344.  
  1345.                             See also 
  1346.  
  1347.   Align command.
  1348.   "Selections" in Chapter 6.
  1349.  
  1350. æKY Alert
  1351. æC                     Alert -- display an alert box
  1352.  
  1353. Alert [-s] [message…] < file
  1354.  -s                      # silent, don't beep when dialog is displayed
  1355.  
  1356. Status codes returned:
  1357.   0    No errors.
  1358.   1    Syntax error.
  1359.  
  1360.                            Description
  1361.  
  1362.   Displays an alert box containing the prompt message. The alert is
  1363.   displayed until its OK button is clicked. If the message contains
  1364.   any special characters, you’ll need to quote it.
  1365.  
  1366.  
  1367.                             Examples
  1368.  
  1369.   Alert Please insert next disk to be searched.
  1370.  
  1371.   Displays the following alert box and waits for the user to click
  1372.   "OK" before returning.
  1373.  
  1374.                             Also see
  1375.  
  1376.  Confirm and Request commands.
  1377. æKY Alias
  1378. æC               Alias  -- define or write command aliases
  1379.  
  1380. Alias [name [word…]]  > aliasList
  1381.  
  1382. Status codes returned:
  1383.   0    No errors.
  1384.   1    The specified alias could not be found.
  1385.  
  1386.                            Description
  1387.  
  1388.   Name becomes an alias for the list of words. Subsequently, when name
  1389.   is used as a command name, word… will be substituted in its place.
  1390.  
  1391.   If only name is specified, any alias definition associated with name
  1392.   is written to standard output. If name and word are both omitted,
  1393.   a list of all aliases and their values is written to standard output.
  1394.   (This output is in the form of Alias commands.)
  1395.  
  1396.   Aliases are local to the script in which they are defined. An initial
  1397.   list of aliases is inherited from the enclosing script. Inherited
  1398.   aliases may be overridden locally. You can make an alias definition
  1399.   available to all scripts by placing the definition in the UserStartup
  1400.   file.
  1401.  
  1402.   You can remove aliases with the Unalias command.
  1403.  
  1404.  
  1405.                              Examples
  1406.  
  1407.   Alias Dir Directory
  1408.  
  1409.   Creates an alias "Dir" for the Directory command.
  1410.  
  1411.   Alias Top 'Find •'
  1412.  
  1413.   Creates an alias "Top" for the command "Find •" (which places the
  1414.   insertion point at the beginning of a window). The command takes
  1415.   an optional window parameter and by default acts on the target window.
  1416.   The Top command could now be used as follows:
  1417.  
  1418.   Top # find top of target window
  1419.  
  1420.   Top Sample.a # find top of window Sample.a
  1421.  
  1422.   # (equivalent to "Find • Sample.a")
  1423.  
  1424.                             See also
  1425.  
  1426.   Unalias command.
  1427.   "Command Aliases" in Chapter 5.
  1428.  
  1429. æKY Align
  1430. æC                 Align -- align text to left margin
  1431.  
  1432. Align [-c count] selection [window]
  1433.  -c count                # repeat the Align count times
  1434.  
  1435. Status codes returned:
  1436.   0    At least one instance of the selection was found.
  1437.   1    Syntax error.
  1438.   2    Any other error.
  1439.  
  1440.                            Description
  1441.  
  1442.   All lines within each instance of the selection are positioned to
  1443.   the same distance from the left margin as the first line in the selection.
  1444.  
  1445.   If you specify the window parameter, the Align command will act on
  1446.   window. It’s an error to specify a window that doesn’t exist. If
  1447.   no window is specified, the command operates on the target window
  1448.   (the second window from the front).
  1449.  
  1450.  
  1451.                              Examples
  1452.  
  1453.   Align §
  1454.  
  1455.   Same as the Align menu item; that is, it aligns all lines in the
  1456.   default selection with the first line of the selection.
  1457.  
  1458.   Align /Begin/:/End/
  1459.  
  1460.   Selects everything from the next "Begin" through the following "End",
  1461.   and aligns all lines within the selection to the same margin position
  1462.   as the line that contains the "Begin".
  1463.  
  1464.                              See Also
  1465.  
  1466.  Adjust command.
  1467.   "Selections" in Chapter 6.
  1468.  
  1469. æKY Asm
  1470. æC                    Asm -- MC68xxx Macro Assembler
  1471.  
  1472. Asm [option…] [file…]  < file > listing ≥ progress
  1473.  -addrsize size          # set size of address display
  1474.  -blksize blocks         # use blocks * 512 byte I/O buffers
  1475.  -case on                # distinguish between upper and lower case
  1476.  -case obj[ect]          # preserve case in object file
  1477.  -case off               # ignore case (default)
  1478.  -c[heck]                # syntax check only, don't create object file
  1479.  -d[efine] name          # equivalent to: name EQU 1
  1480.  -d[efine] name=value    # equivalent to: name EQU value
  1481.  -d[efine] &name         # equivalent to: &name SET[AC] 1
  1482.  -d[efine] &name=value   # equivalent to: &name SET[AC] value
  1483.  -e[rrlog] file          # write errors and warnings to file
  1484.  -f                      # suppress page ejects in listing
  1485.  -font name[,size]       # set listing font and size
  1486.  -h                      # suppress page headers in listing
  1487.  -i directory,…          # search for includes in directory,…
  1488.  -l                      # write full listing to output
  1489.  -lo file                # listing output file or directory
  1490.  -model far              # allow generation of load-time relocatable 32-bit references 
  1491.  -model near             # prohibit generation of load-time relocatable 32-bit
  1492.                          #    references (the default)
  1493.  -o objname              # generate code in file or directory objname
  1494.  -pagesize l[,w]         # set listing page length and width
  1495.  -print mode             # equivalent to: PRINT mode
  1496.  -p                      # write progress information to diagnostics
  1497.  -s                      # write short listing to output
  1498.  -sym off                # no SADE records
  1499.  -sym on|full            # full SADE records; can modify with [,nolines] 
  1500.                          # [,notypes] [,novars]
  1501.  -t                      # write time and total lines to diagnostics
  1502.  -w                      # suppress warnings
  1503.  -wb                     # suppress warnings on branch instructions
  1504.  
  1505. Status codes returned:
  1506.   0    No errors detected in any of the files assembled.
  1507.   1    Parameter or option errors.
  1508.   2    Errors detected.
  1509.  
  1510.                            Description
  1511.  
  1512.   Assembles the specified assembly-language source files. One or more
  1513.   filenames may be specified. If no filenames are specified, standard
  1514.   input is assembled and the file "a.o" is created. By convention,
  1515.   assembly-language source filenames end in the suffix ".a". Each file
  1516.   is assembled separately—assembling file name.a creates object file
  1517.   name.a.o. The object filename can be changed with the -o option.
  1518.  
  1519.   See the MPW 3.0 Assembler Reference for more information about the
  1520.   assembly language. The first Commando dialog box for this command
  1521.   is reproduced here for convenience.
  1522.  
  1523.  
  1524.                              Examples
  1525.  
  1526.   Asm -w -l Sample.a Memory.a -d Debug
  1527.  
  1528.   Assembles Sample.a and Memory.a, producing object files Sample.a.o
  1529.   and Memory.a.o. Suppresses warnings and defines the name Debug as
  1530.   having the value 1. Two listing files are generated: Sample.a.lst
  1531.   and Memory.a.lst. (Sample.a and Memory.a are located in the AExamples
  1532.   directory.)
  1533.  
  1534.                             See Also
  1535.  
  1536.   MPW3.0 Assembler Reference.
  1537.  
  1538. æKY Backup
  1539. æC                     Backup -- folder file backup
  1540.  
  1541. Backup [option…] -from folder -to folder [file…]  > commands ≥ progress
  1542.  -a                      # copy all files in "from" not in "to"
  1543.  -alt                    # alternate prompts for disk drives
  1544.  -busy folder            # move "busy" files to the specified folder
  1545.  -c                      # create "to" folders if they don't exist
  1546.  -check checkopt,…       # produce reports based on checkopt
  1547.                          # checkopt=from     "from" not in "to"
  1548.                          #          to       "to" not in "from"
  1549.                          #          allfroms "from" not in "to" even if none
  1550.                          #          alltos   "to" not in "from" even if none
  1551.                          #          folders  "from" folders not in "to"
  1552.                          #          newer    "to"s newer than "from"s
  1553.  -co filename            # redirect -check reports to filename
  1554.  -compare [only][,'opts']# write compare commands for out-of-date files
  1555.  -d                      # write delete commands for files in "to" not in "from"
  1556.  -do [only][,'command']  # write the command string specified by command…
  1557.  -e                      # eject disk when done
  1558.  -from folder|drive      # specify source folder or drive (1 or 2)
  1559.  -l                      # write directory listing of "from" files
  1560.  -lastcmd 'command'      # write the command string as the last command
  1561.  -level n                # restrict -a and -d to files beyond level n
  1562.  -m                      # multi-disk -- more than one "from" or "to" disk
  1563.  -n                      # show folder nesting by indenting commands 
  1564.  -p                      # write progress information to diagnostics
  1565.  -r                      # recursively process nested folders
  1566.  -revert                 # revert "to" files to their "from" state
  1567.  -since date[,time]|fname# process only files since specified time
  1568.  -sync                   # synchronize both source and destination folders
  1569.  -t type                 # process only files of specified type
  1570.  -to folder|drive        # specify destination folder or drive (1 or 2)
  1571.  -y                      # suppress duplicate -y option
  1572.  
  1573. Status codes returned:
  1574.   0    No errors; Shell duplicate commands have been generated or filenames were     listed.
  1575.   1    Parameter or option errors.
  1576.   3    No errors and no files to duplicate or list.
  1577.   Note:  Backup returns a status code of 3 when no files need copying. 
  1578.        If no files are copied because none of the files in the source folder 
  1579.        exists in the destination folder, Backup also reports a warning to 
  1580.        the diagnostic output file. If there are no name matches, it is 
  1581.        possible that your from/to pathnames were specified incorrectly. 
  1582.        Hence, Backup lets you know of the possible error. Backup does not 
  1583.        report this as an error if you use the  -l, -a, or -since option.
  1584.  
  1585.                            Description
  1586.  
  1587.   Files in a source ("from") folder are copied to a destination ("to")
  1588.   folder based on the modification date. By default, only files that
  1589.   already exist in both the source and destination folders are candidates
  1590.   for copying. (The -a option can override this default.) Backup does
  1591.   not actually make the copies. Instead, it generates a script of MPW
  1592.   Shell duplicate commands.
  1593.  
  1594.   Backup’s default operation is based on the premise that you already
  1595.   have an existing folder on two sets of disks (generally a hard disk
  1596.   and a set of 3.5-inch disks—drive numbers may be specified as folder
  1597.   "names") and that you want to make sure that the files on one of
  1598.   the disks are the same as the files on the other disk. Thus, it is
  1599.   the files on the destination ("to") disk that determine which files
  1600.   can be copied from the source ("from") disk.
  1601.  
  1602.   A Shell duplicate command is generated to the standard output file
  1603.   if
  1604.  
  1605.     • a file on a source disk also exists on the destination disk,
  1606.     and
  1607.  
  1608.     • the modification date of the source is newer than that of the
  1609.     destination.
  1610.  
  1611.   In addition to the basic function of generating Shell duplicate commands,
  1612.   Backup also provides these services:
  1613.  
  1614.     • Folders can be recursively processed, allowing processing of
  1615.     all folders and subfolders contained within folders (-r).
  1616.  
  1617.     • Compare commands can be generated for out-of-date files of
  1618.     type TEXT to discover why the files are different (-compare).
  1619.  
  1620.     • Filenames that exist on one disk and not on the other can be
  1621.     displayed
  1622.  
  1623.   (-check from,to).
  1624.  
  1625.     • File folder names that don’t exist on the destination can be
  1626.     displayed
  1627.  
  1628.   (-check folders).
  1629.  
  1630.     • Filenames in the destination that are newer than the source
  1631.     can be displayed
  1632.  
  1633.   (-check newer).
  1634.  
  1635.  
  1636.                              Examples
  1637.  
  1638.   backup  -from :HDfolder:  -e
  1639.  
  1640.   Check that all files on the disk in drive 1 (-to is omitted, so "-to
  1641.   1" is implied) are up to date with respect to the files in :HDfolder:.
  1642.   If they are, the disk in drive 1 is ejected. If not, the appropriate
  1643.   Duplicate commands are generated to update the out-of-date files
  1644.   on the disk in drive 1. An Eject 1 command is generated to eject
  1645.   the disk after the Duplicate commands are processed.
  1646.  
  1647.   backup  -r  -from FServer:MPW:  -to HD:MPW:  -check folders
  1648.  
  1649.   Recursively process (-r) all the files in all the folders on FServer:MPW:
  1650.   to make sure that the files on HD:MPW: are up-to-date. Appropriate
  1651.   Duplicate commands are generated to copy the out-of-date files from
  1652.   the folders in FServer:MPW: to the folders in HD:MPW:. It is assumed
  1653.   that the folder names in HD:MPW: are the same as the folder names
  1654.   in FServer:MPW:. Any folders in FServer:MPW: that don’t exist in
  1655.   HD:MPW are skipped. Because the -check option is specified, a list
  1656.   of all the skipped folders is written to the diagnostic file.
  1657.  
  1658.   Limitations Multi-disk operation (-m) is not supported with recursion
  1659.   (-r).
  1660.  
  1661.   The -e option is ignored when -m is specified.
  1662.  
  1663.   Only drive numbers 1 and 2 are supported, and they are assumed to
  1664.   be ejectable 3.5-inch disk drives.
  1665.  
  1666. æKY Beep
  1667. æC                       Beep -- generate tones
  1668.  
  1669. Beep [note [,duration [,level]]]…
  1670.  #   duration is given in sixtieths of a second (default is 15)
  1671.  #   sound level is given as a number from 0 to 255 (default is 128)
  1672.  
  1673. Status code returned:
  1674.    0    no errors.
  1675.  
  1676.  
  1677.                            Description
  1678.  
  1679.   For each parameter, Beep produces the given note for the specified
  1680.   duration and sound level on the Macintosh speaker. If no parameters
  1681.   are given, a simple beep is produced.
  1682.  
  1683.   Note is one of the following:
  1684.  
  1685.     • A number indicating the count field for the square wave generator,
  1686.     as described in chapter "Summary of the Sound Driver" of Inside
  1687.     Macintosh.
  1688.  
  1689.     • A string in the following format:
  1690.  
  1691.   [ n ] letter [ # | b ]
  1692.  
  1693.   n is an optional number between –3 and 3 indicating the octaves below
  1694.   or above middle C, followed by a letter indicating the note (A–G)
  1695.   and an optional sharp (#) or flat (b) sign. Note that any sharps
  1696.   (#) must be enclosed in quotation marks—otherwise they will be interpreted
  1697.   as comment delimiters.
  1698.  
  1699.   The optional duration is given in sixtieths of a second. The default
  1700.   duration is 15 (one-quarter second).
  1701.  
  1702.   The optional sound level is given as a number from 0 to 255. The
  1703.   default level is 128.
  1704.  
  1705.  
  1706.                              Examples
  1707.  
  1708.   Beep
  1709.  
  1710.   Produce a simple beep on the speaker.
  1711.  
  1712.   Beep 2C,20 '2C#,40' 2D,60
  1713.  
  1714.   Play the three notes specified: C , C sharp, and D—all two octaves
  1715.   above middle C—for one-third, two-thirds, and one full second, respectively.
  1716.   Notice that the second parameter must be quoted; otherwise the sharp
  1717.   character (#) would indicate a comment.
  1718.  
  1719. æKY Begin
  1720. æC                      Begin  -- group commands
  1721.  
  1722. Begin
  1723.  command…
  1724. End
  1725.  
  1726. The status code of the last command executed is returned. 
  1727. (If no commands appear between Begin and End, 0 is returned.)
  1728.  
  1729.                            Description
  1730.  
  1731.   Groups commands for pipe specifications, conditional execution, and
  1732.   input/output specifications. Carriage returns must appear at the
  1733.   end of each line as shown above, or be replaced with semicolons (
  1734.   ; ). If the pipe symbol (|), conditional execution operators (&&
  1735.   and ||), or input/output specifications (<, >, >>, ≥, ≥≥, ∑, ∑∑)
  1736.   are used, the operator must appear after the End command and applies
  1737.   to all of the enclosed commands.
  1738.  
  1739.     • Note: Begin and End behave like left and right parentheses.
  1740.     Once the Begin command has been executed, the Shell will not
  1741.     execute any of the subsequent commands until it encounters the
  1742.     End command, so that input/output specifications can be processed.
  1743.  
  1744.  
  1745.                              Examples
  1746.  
  1747.   The following commands save the current variables, exports, aliases,
  1748.   and menus in the file SavedState.
  1749.  
  1750.   Begin
  1751.     Set
  1752.     Export
  1753.     Alias
  1754.     AddMenu
  1755.   End > SavedState
  1756.  
  1757.   Notice that the output specification following "End" applies to all
  1758.   of the commands within the Begin…End control command. This command
  1759.   is identical to the following:
  1760.  
  1761.   (Set; Export; Alias; AddMenu) > SavedState
  1762.  
  1763.   The commands Set, Export, Alias, and AddMenu write their output in
  1764.   the form of commands; these commands can be executed to redefine
  1765.   variables, exports, aliases, and menus, respectively. Therefore,
  1766.   after executing the above commands, the command
  1767.  
  1768.   Execute SavedState
  1769.  
  1770.   will restore all of these definitions. You must "execute" the script
  1771.   so that the variables and aliases are applied to the current scope.
  1772.  
  1773.     • Note: This technique is used in the Suspend script to save
  1774.     state information. (You might want to take a look at Suspend,
  1775.     which also saves the list of open windows and the current directory.)
  1776.     The Resume file runs the file that Suspend creates, restoring
  1777.     the various definitions, reopening the windows, and resetting
  1778.     the current directory.
  1779.  
  1780. æKY Break
  1781. æC                   Break -- break from For or Loop
  1782.  
  1783. Break [If expression]
  1784.  
  1785. Status codes returned:
  1786.   0    No errors detected.
  1787.   –3   Break is found outside a For…End or Loop…End, or the parameters
  1788.        to Break are incorrect.
  1789.   –5   Invalid expression.
  1790.  
  1791.                            Description
  1792.  
  1793.   If expression is nonzero, Break terminates execution of the immediately
  1794.   enclosing For or Loop command. (Null strings are considered zero.)
  1795.   If the "If expression" is omitted, the break is unconditional. (For
  1796.   a definition of expression, see the Evaluate command.)
  1797.  
  1798.  
  1799.                              Examples
  1800.  
  1801.   Set Exit 0
  1802.   For file in Startup UserStartup Suspend Resume Quit
  1803.     EnTab "{file}" > temp
  1804.     Break If {Status} != 0
  1805.     Rename -y temp "{file}"
  1806.     Print -h "{file}"
  1807.     Echo "{file}"
  1808.   End
  1809.  
  1810.   This For loop entabs and prints each of the special MPW scripts;
  1811.   the Break command terminates the loop if a nonzero status value is
  1812.   returned. (See the For command for further explanation of this example.)
  1813.  
  1814.   Set loopcount |
  1815.     Loop
  1816.     Break if {loopcount} > 10
  1817.     Echo "Loop Number {loopcount}"
  1818.     Evaluate loopcount +=1
  1819.   End
  1820.  
  1821.   This example loops until the variable {loopcount} is greater than
  1822.   10. Use of the Evaluate command is also demonstrated.
  1823.  
  1824.  
  1825.                              See also 
  1826.  
  1827.   For, Loop, and If commands.
  1828.  
  1829.   Evaluate command (for a description of expressions).
  1830.  
  1831.   "Structured Commands" in Chapter 5.
  1832.  
  1833. æKY Browser
  1834. æC                Browser -- invoke Marker Browser
  1835.  
  1836.                   # The MPW Browser command is used to navigate source files or other text.  It 
  1837.                   # presents a window containing a list of the files in the current directory
  1838.                   # and, for the selected file, a list of markers.  Double-clicking on the marker
  1839.                   # opens the file with the selection point at the marker.  Entering a marker name
  1840.                   # in a text box searches all files in the directory for that marker, and if found 
  1841.                   # opens the file with the selection point at the marker.
  1842.  
  1843. æKY BuildCommands
  1844. æC                BuildCommands -- show build commands
  1845.  
  1846. BuildCommands program [option…] > commands
  1847.  option…                 # Make command options
  1848.  
  1849. Status code 0 is returned if the build commands are generated 
  1850. without error.  If an error occurs, the status code returned by Make is returned.
  1851.  
  1852.                            Description
  1853.  
  1854.   BuildCommands writes to standard output the commands needed to build
  1855.   the specified program.
  1856.  
  1857.   Make is used to generate the build commands. If file program.make
  1858.   exists, it is used as the makefile. If not, file MakeFile is used.
  1859.  
  1860.   The specified options control the generation of the build commands.
  1861.   The options are passed directly to Make. BuildCommands is used to
  1862.   implement the Show Build Commands and Show Full Build Commands menu
  1863.   items in the Build Menu.
  1864.  
  1865.  
  1866.                              Examples
  1867.  
  1868.   Open {Worksheet}
  1869.  
  1870.   BuildCommands Count >> {Worksheet} ≥≥ Dev:StdOut
  1871.  
  1872.   Generates the build commands for Count. The Worksheet window is brought
  1873.   to the front. The build commands, or any errors generated by Make
  1874.   are written at the end of the Worksheet. The Show BuildCommands menu
  1875.   item is implemented using similar commands.
  1876.  
  1877.  
  1878.                              See also 
  1879.  
  1880.   "Building a Program:  An Introduction" in Chapter 2
  1881.  
  1882.       
  1883. æKY BuildMenu
  1884. æC                  BuildMenu -- create the Build menu
  1885.  
  1886. Status codes returned:
  1887.  0    is always returned.
  1888.  
  1889.                            Description
  1890.  
  1891.   Creates the Build menu shown below. Each of the items in the menu
  1892.   is described in Chapter 3 of the MPW Manual.
  1893.  
  1894.  
  1895.                              Examples
  1896.  
  1897.   BuildMenu
  1898.  
  1899.   Creates the Build menu. This command should appear in the UserStartup
  1900.   file to create the Build menu.
  1901.  
  1902.  
  1903.                              See also 
  1904.  
  1905.   "Building a Program: An Introduction" in Chapter 2.
  1906.  
  1907. æKY BuildProgram
  1908. æC             BuildProgram -- build the specified program
  1909.  
  1910. Status code 0 is returned if the build is completed without error. 
  1911. If an error occurs during the generation of the build commands, the status 
  1912. value returned by Make is returned. If an error occurs during the build, the 
  1913. Status value returned by the build step that detected the error (such as Asm 
  1914. or Link) is returned.
  1915.  
  1916. BuildProgram program [option…] > log
  1917.  option…                 # Make command options
  1918.  
  1919.                            Description
  1920.  
  1921.   Builds the specified program. A simple transcript of the build, including
  1922.   timing information and commands used to do the build, is written
  1923.   to standard output.
  1924.  
  1925.   Make is used to determine the commands needed to do the build. If
  1926.   file
  1927.  
  1928.   program.make exists, it is used as the makefile. If not, the file
  1929.   MakeFile is used.
  1930.  
  1931.   The options specified are passed directly to Make; they control the
  1932.   generation of the build commands. BuildProgram is used to implement
  1933.   the Build and Full Build menu items in the Build menu.
  1934.  
  1935.  
  1936.                              Examples
  1937.  
  1938.   Open {Worksheet}
  1939.  
  1940.   BuildProgram -e Count >> {Worksheet} ≥≥ Dev:StdOut
  1941.  
  1942.   Completely rebuilds Count. The Worksheet window is brought to the
  1943.   front. The transcript of the build and any errors are written at
  1944.   the end of the Worksheet. The Full Build menu command is implemented
  1945.   using similiar commands.
  1946.  
  1947.  
  1948.                              See also 
  1949.  
  1950.   "Building a Program:  An Introduction" in Chapter 2
  1951.  
  1952. æKY C
  1953. æC                            C -- C compiler
  1954.  
  1955. C [option…] [file]   < file > preprocessor ≥ progress
  1956.     -b                      # put string constants into code and generate PC-relative references
  1957.                             #   for function addresses
  1958.     -b2                     # implies '-b' above, and allows string constants to be overlaid
  1959.     -b3                     # overlaid string constants in code (but A5-relative references
  1960.                             # for function addresses)
  1961.     -bigseg                 # generate single large (>32K) code segment, 68020 only   
  1962.     -c                      # syntax check only, don't create object file
  1963.     -d name                 # equivalent to: #define name 1
  1964.     -d name=string          # equivalent to: #define name string
  1965.     -e                      # write preprocessor results to output
  1966.     -e2                     # implies '-e' above, and strips comments
  1967.     -elems881               # generate MC68881 code for transcendentals
  1968.     -i directory            # search for includes in directory
  1969.     -k directory            # create load/dump files in directory
  1970.     -m                      # generate 32-bit references for data (less efficient code)
  1971.     -mbg ch8                # v2.0 compatible macsbug symbols
  1972.     -mbg off                # no macsbug symbols in the code 
  1973.     -mbg on|full            # full macsbug symbols
  1974.     -mbg <n>                # macsbug symbols to length <n> (<n> can be 0..255)
  1975.     -mc68020                # generate MC68020 code 
  1976.     -mc68881                # generate MC68881 code for arithmetic operations
  1977.     -model farCode|         # generate load-time relocatable 32-bit references for
  1978.         farData|far         #   code, data, or both
  1979.     -model nearCode|        # generate 16-bit references for code, data, or both 
  1980.         nearData|near       #   (the default)
  1981.     -n                      # Turn pointer assignment incompatibility errors into warnings
  1982.     -notonce                # do not automatically suppress multiple inclusion of files
  1983.     -o objname              # generate code in file or directory objname
  1984.     -opt off                # don't apply code optimizations
  1985.     -opt on | full          # choose level of code optimization ( on is default );
  1986.                             #    can modify with [,nopeep] [,nocse]
  1987.                             #    ( no peephole, no common subexpression)
  1988.     -p                      # write progress information to diagnostic
  1989.     -r                      # warn on calling a function that has no definition
  1990.     -s segment              # generate code in segment
  1991.     -sym off                # don't generate SADE records
  1992.     -sym on | full          # generate SADE records; can modify with [,nolines] [,notypes] [,novars]
  1993.     -t                      # write compilation time to diagnostic
  1994.     -trace always|never     # enable/disable calls to profiler or MacApp debugger
  1995.                             #   (overrides #pragma trace on|off)
  1996.     -trace on|off           # enable/disable calls to profiler or MacApp debugger
  1997.                             #   (subject to #pragma trace on|off)
  1998.     -u name                 # equivalent to: #undef name
  1999.     -warnings on|off|full   # set warning level; "on" is the default
  2000.     -y directory            # create temporary files in directory
  2001.  
  2002. Status codes returned:
  2003.   0    Successful completion.
  2004.   1    Errors occurred.
  2005.  
  2006.                            Description
  2007.  
  2008.   Compiles the specified C source file. Compiling file Name.c creates
  2009.   object file Name.c.o. (By convention, C source filenames end in a
  2010.   ".c" suffix.) If no filenames are specified, standard input is compiled
  2011.   and the object file "c.o" is created.
  2012.  
  2013.   (Note that SADE object file information cannot be generated for standard
  2014.   input source files.)
  2015.  
  2016.   See the MPW 3.0 C Reference Manual for details of the C language
  2017.   definition.
  2018.  
  2019.                              Examples
  2020.  
  2021.   C -p Sample.c
  2022.  
  2023.   Compiles Sample.c, producing the object file Sample.c.o. Writes progress
  2024.   information to diagnostic output. (Sample.c is found in Examples:CExamples.)
  2025.  
  2026.  
  2027.                              See also 
  2028.  
  2029.   MPW3.0C Reference.
  2030.  
  2031.  
  2032. æKY Canon
  2033. æC                   Canon -- canonical spelling tool
  2034.  
  2035. Canon [option…] dictionary [file…]   < file > new
  2036.  -s                      # case sensitive replacement
  2037.  -a                      # assembler identifiers (include $, %, @)
  2038.  -c n                    # consider only the first n characters
  2039.  
  2040. Status codes returned:
  2041.   0    All files processed successfully.
  2042.   1    Error in command line.
  2043.   2    Other errors.
  2044.  
  2045.                            Description
  2046.  
  2047.   Canon copies the specified files to standard output, replacing identifiers
  2048.   with the canonical spellings given in dictionaryFile. If no files
  2049.   are specified, standard input is processed.
  2050.  
  2051.   DictionaryFile is a text file that specifies the identifiers to be
  2052.   replaced and their new (or canonical) spellings. Identifiers are
  2053.   defined as a letter followed by any number of letters or digits.
  2054.   (The underscore character ( _ ) is also considered a letter.) Each
  2055.   line in the dictionary contains either a pair of identifiers or a
  2056.   single identifier:
  2057.  
  2058.     • If two identifiers appear, the first is the identifier to replace,
  2059.     and the second is its canonical spelling. For example, the dictionary
  2060.     entry
  2061.  
  2062.     NIL NULL # change NIL to NULL
  2063.  
  2064.     changes each occurrence of "NIL" to "NULL".
  2065.  
  2066.     • A single identifier specifies both the identifier to match
  2067.     and its canonical spelling. This feature is useful because the
  2068.     matching may not be case sensitive or restricted to a fixed number
  2069.     of characters. (See the "Options" section on the next page.)
  2070.     For example, the dictionary entry
  2071.  
  2072.     true
  2073.  
  2074.     changes all occurrences of "TRUE", "True", "tRUE", and so on to "true".
  2075.  
  2076.   You can specify a left context for the first identifier on each line
  2077.   of the dictionary by preceding it with a sequence of nonidentifier
  2078.   characters. Replacement will then occur only if the left context
  2079.   in the input file exactly matches the left context in the dictionary.
  2080.   For example, if C structure component upperLeft should be replaced
  2081.   with topLeft, the dictionary might include the following:
  2082.  
  2083.   .upperLeft topLeft
  2084.   ->upperLeft topLeft
  2085.  
  2086.   You can include comments in the dictionary file by using the # symbol:
  2087.   everything from the # to the end of the line is ignored.
  2088.  
  2089.     • Note: The file Canon.Dict is a sample dictionary file that’s
  2090.     included with MPW. (See the "Examples" section below.)
  2091.  
  2092.  
  2093.                              Examples
  2094.  
  2095.   The file Canon.Dict, in the Tools folder, contains a list of all
  2096.   of the identifiers used in the Standard C library and the Inside
  2097.   Macintosh C interfaces. This list was made from the Library Index
  2098.   in the MPW 2.0 C Reference. The entries in Canon.Dict look like the
  2099.   following:
  2100.  
  2101.   abbrevDate
  2102.   ABCallType
  2103.   abortErr
  2104.   ABProtoType
  2105.   abs
  2106.   acos
  2107.   activateEvt
  2108.   …
  2109.  
  2110.   The following command copies the file Source.c to the file Temp;
  2111.   identifiers whose first eight characters match a dictionary entry
  2112.   are replaced with that entry.
  2113.  
  2114.   Canon -c 8 {MPW}Tools:Canon.Dict Source.c > Temp
  2115.  
  2116.   The -c 8 option is useful when porting source code from other systems
  2117.   where only eight characters are significant.
  2118.  
  2119.     • Note: The list of Pascal identifiers used in the Inside Macintosh
  2120.     interface is almost identical to the list used in C. The dictionary
  2121.     Canon.Dict can also be used to port Pascal programs from other
  2122.     systems, as long as you use the canonical capitalizations for
  2123.     the various Standard C library identifiers.
  2124.  
  2125.   Limitations The maximum line length in the dictionary file is 256
  2126.   characters. Longer lines are considered an error. Identifiers and
  2127.   words in comment sections are replaced.
  2128.  
  2129. æKY Catenate
  2130. æC                    Catenate -- concatenate files
  2131.  
  2132. Catenate [file…]  < file > catenation
  2133.  
  2134. Status codes returned:
  2135.   0    All files were processed successfully.
  2136.   1    One or more files were not found.
  2137.   2    An error occurred in reading or writing.
  2138.  
  2139.                            Description
  2140.  
  2141.   Catenate reads the data fork of each file in sequence and writes
  2142.   it to standard output. If no input file is given, Catenate reads
  2143.   from standard input. None of the input files may be the same as the
  2144.   output file.
  2145.  
  2146.  
  2147.                              Examples
  2148.  
  2149.   Catenate Makefile.a
  2150.  
  2151.   Writes Makefile.a to the active window immediately following the
  2152.   command.
  2153.  
  2154.   Catenate File1 File2 > CombinedFile
  2155.  
  2156.   Concatenates the first two files and places the result in the third.
  2157.   If CombinedFile doesn’t exist, it will be created; if it exists,
  2158.   it will be overwritten.
  2159.  
  2160.   Set selection "`Catenate §`"
  2161.  
  2162.   Captures the selection from the target window in the Shell variable
  2163.   {selection}.
  2164.  
  2165.   Catenate >> {Worksheet}
  2166.  
  2167.   Appends all subsequently entered text to the Worksheet window (until
  2168.   you indicate end-of-file by pressing Command-Enter).
  2169.  
  2170.   Warning Beware of commands such as
  2171.  
  2172.   Catenate File1 File2 > File1
  2173.  
  2174.   The above command will cause the original data in File1 to be lost.
  2175.   To append one file to another, use the form
  2176.  
  2177.   Catenate File2 >> File1
  2178.  
  2179.  
  2180.                              See also 
  2181.  
  2182.   Duplicate command.
  2183.  
  2184.   "Redirecting Input and Output" in Chapter 5.
  2185.  
  2186. æKY CFront
  2187. æC                     CFront -- C++ to C translator
  2188.  
  2189. CFront [option…] [file…] < file > intermediate output ≥ progress
  2190.     -a                      # force ANSI-style intermediate C code (default)
  2191.     -a0                     # force K&R-style (pre-ANSI) intermediate C code
  2192.     -a1                     # force ANSI-style intermediate C code (default)
  2193.     -c                      # intermediate code to standard output; no object file
  2194.     -d name                 # equivalent to: #define name 1
  2195.     -d name=string          # equivalent to: #define name string
  2196.     -e                      # write preprocessor results to output
  2197.     -e2                     # implies '-e' above, and strips comments
  2198.     -elems881               # generate MC68881 code for transcendentals
  2199.     -f filename             # act as if input comes from named file when it actually is from stdin 
  2200.     -f1                     # send text version of C code to C compiler (no token stream)
  2201.     -i directory            # search for includes in directory
  2202.     -mc68020                # generate MC68020 code 
  2203.     -mc68881                # generate MC68881 code for arithmetic operations
  2204.     -mtbl0                  # suppress output of method tables for Object Pascal Classes
  2205.     -mtbl1                  # force output of method tables for Object Pascal Classes
  2206.     -n                      # Turn pointer assignment incompatibilty errors into warnings
  2207.     -p                      # write progress information to diagnostic
  2208.     -s segment              # generate code in segment
  2209.     -u name                 # equivalent to: #undef name
  2210.     -vtbl0                  # suppress output of virtual tables for ordinary class
  2211.     -vtbl1                  # force output of virtual tables for ordinary class
  2212.     -vtbl2                  # new improved output algorithm for virtual tables
  2213.     -w                      # suppress warnings
  2214.     -w1                     # generate additional warnings from CFront
  2215.     -w3                     # passed through to C compiler (supresses unused warnings)
  2216.     -y directory            # create temporary files in directory
  2217.     -z0                     # force 'inline' functions to be non-inline
  2218.     -z3                     # supress name encoding of local vars and struct members (default)
  2219.     -z4                     # encode names of local vars and struct members
  2220.     -z6                     # force enums always to be int variables
  2221.     -z7                     # relax requirement on static class member initialization 
  2222.  
  2223. æKY CheckIn
  2224. æC                CheckIn -- check a file into a project
  2225.  
  2226. CheckIn -w | -close | ([options…] files…) > progress
  2227.  -a                 # checkin all files in current directory
  2228.  -b                 # check in files… as branches
  2229.  -c                 # cancel if conflict occurs (avoids dialog)
  2230.  -cf file           # the comment is contained in file.
  2231.  -close             # close the Check In window
  2232.  -cs comment        # a description of changes made to the file
  2233.  -delete            # delete the file after checking it in
  2234.  -m                 # check out the files for modification after checking in
  2235.  -n                 # answer no to all dialogs (avoids dialogs)
  2236.  -new               # add a new file to the project
  2237.  -p                 # write progress information to standard output
  2238.  -project project   # name of project that contains the files
  2239.  -t task            # a short description of task accomplished
  2240.  -touch             # touch the mod date of file after checking in
  2241.  -u user            # name of current user
  2242.  -verify            # verify the contents of the checked in file
  2243.  -w                 # open the Check In window
  2244.  -y                 # answer yes to all dialogs (avoids dialogs)
  2245.  
  2246. Status codes returned:
  2247.   0    No errors.
  2248.   1    Syntax error.
  2249.   2    Error in processing.
  2250.   3    System error.
  2251.  
  2252.                            Description
  2253.  
  2254.   Return ownership of the specified files to Projector and save all
  2255.   changes as new revisions. The default is to leave you with a read-only
  2256.   copy of the file.
  2257.  
  2258.   File must be an HFS pathname. Projector determines the project each
  2259.   file belongs to by inspecting the file's resource fork. Since Projector
  2260.   puts the name of the project in the resource fork of checked-out
  2261.   files, files belonging to different projects can be checked in with
  2262.   a single command.
  2263.  
  2264.   If the -a (all) option is used instead of file..., Projector examines
  2265.   all files in the current directory and checks in all files in the
  2266.   current directory that have been checked out for modification. The
  2267.   files are checked into their respective projects.
  2268.  
  2269.   To add a new file to the project, use the -new option.
  2270.  
  2271.   When the file is checked in, Projector automatically increments the
  2272.   revision number by one. For example, if revision 2.17 was checked
  2273.   out, the new revision will be 2.18. To override this, use the ProjectInfo
  2274.   command to find the revision number, increase it by the amount desired,
  2275.   and then check the file in, using the "filename,rev" notation. For
  2276.   example, if file.c revision 2.17 was checked out, you could check
  2277.   it in as file.c,3.0 to jump to the next major revision level.
  2278.  
  2279.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  2280.   symbols used in Projector commands.
  2281.  
  2282.  
  2283.                              Examples
  2284.  
  2285.   CheckIn file.c -cs "added some comments"
  2286.  
  2287.   Check in file.c to the current project. A new revision of file.c
  2288.   is created and the user is left with a read-only copy of the file.
  2289.   The comment is saved with the new revision. Because no revision number
  2290.   is specified, Projector simply increases the revision number by one.
  2291.  
  2292.   CheckIn file.c interface.c,5 -t "Added -x option"
  2293.  
  2294.   -cf commentFile
  2295.  
  2296.   This command checks in two files reading the comment from the file
  2297.   commentFile. The task is also saved with the new revisions. The user
  2298.   is left with read-only copies of the files. The new revision for
  2299.   interface.c is revision 5.
  2300.  
  2301.   CheckIn hd:work:file.c hd:work:main.c -m
  2302.  
  2303.   The files to be checked in are hd:work:file.c and :main.c. After
  2304.   the command executes, the user still has modifiable copies of the
  2305.   files.
  2306.  
  2307.   CheckIn -new file.c
  2308.  
  2309.   To check a new file into the project use the -new option. The above
  2310.   command adds file.c to the current project.
  2311.  
  2312.   CheckOut -project Zoom∫Utilities∫MyProject file.c -m
  2313.  
  2314.   ...edit the file...
  2315.  
  2316.   CheckIn -project Zoom∫Utilities∫MyProject file.c -b
  2317.  
  2318.   The preceding command sequence illustrates the usefulness of the
  2319.   -b option. In this case, the user checked out a write-privileged
  2320.   copy of the latest revision of file.c from the current project, edited
  2321.   the file, and then, using the branch option, checked in the file
  2322.   on a branch.
  2323.  
  2324.  
  2325.                              See also 
  2326.  
  2327.   CheckOut and CheckOutDir.
  2328.  
  2329. æKY CheckOut
  2330. æC              CheckOut -- check a file out from a project
  2331.  
  2332. CheckOut -w | -close | ([options…] files…) > progress
  2333.  -a                    # check out all the files in the current project
  2334.  -b                    # checkout specified files on a new branch
  2335.  -c                    # cancel if conflict occurs (avoids dialog)
  2336.  -cancel               # cancel the checkout of the files
  2337.  -cf file              # the comment is contained in files
  2338.  -close                # close the Check Out window
  2339.  -cs comment           # a short description of changes
  2340.  -d dir                # directory where the checked out files should go
  2341.  -m                    # check out a modifiable copy of the file
  2342.  -n                    # answer no to all dialogs (avoids dialogs)
  2343.  -newer                # checkout latest copy of all files in the project
  2344.  -noTouch              # don't touch the mod date of the checked out files
  2345.  -open                 # open the files after checking out
  2346.  -p                    # write progress information to standard output
  2347.  -project project      # name of project that contains the files
  2348.  -r                    # recursively checkout files
  2349.  -t task               # a short description of task accomplished
  2350.  -u user               # name of current user
  2351.  -update               # checkout latest copy of all files you already have
  2352.  -verify            # verify the contents of the checked out file
  2353.  -w                    # open the Check Out window
  2354.  -y                    # answer yes to all dialogs (avoids dialogs)
  2355.  
  2356. Status codes returned:
  2357.   0    No errors.
  2358.   1    Syntax error.
  2359.   2    Error in processing.
  2360.   3    System error.
  2361.  
  2362.                            Description
  2363.  
  2364.   Under Projector, CheckOut obtains copies of file revisions from a
  2365.   project. The default is to check out read-only copies. Unless otherwise
  2366.   specified, copies are placed in the checkout directory associated
  2367.   with the project.
  2368.  
  2369.   If file is a leafname (that is, file.c), Projector checks out the
  2370.   latest revision of the file from the current project. If file specifies
  2371.   a revision (for example, file.c,22), that revision is checked out.
  2372.  
  2373.   If file is a partial or full HFS pathname (that is, :work:file.c
  2374.   or HD:work:file.c), the file does not go into the checkout directory.
  2375.   Instead, Projector checks out the file (that is, file.c) in the current
  2376.   project and places the copy in the specified HFS location (that is,
  2377.   in the :work: or HD:work: directory, respectively).
  2378.  
  2379.   Finally, file may be a Name. See the NameRevisions command for more
  2380.   information about Names. The Name is expanded and the corresponding
  2381.   revisions are checked out.
  2382.  
  2383.   To check out an old revision for modification, you must specify the
  2384.   -b (branch) option.
  2385.  
  2386.   If you are checking out revision 5 of file.c into hd:work and Projector
  2387.   determines that you already have that revision in the work directory,
  2388.   Projector will not recopy the data of revision 5. This is especially
  2389.   nice when you are checking out a revision for modification, and you
  2390.   already have a read-only copy of that revision.
  2391.  
  2392.   See Chapter 7 of MPW manual for complete definitions of the terms and
  2393.   symbols used in Projector commands.
  2394.  
  2395.  
  2396.                              Examples
  2397.  
  2398.   CheckOut -m -project Zoom∫Utilities∫MyProject file.c
  2399.  
  2400.   Checks out a write-privileged copy of the latest revision of file.c
  2401.   from the Zoom∫Utilities∫MyProject project. The file is placed in
  2402.   the checkout directory for the project.
  2403.  
  2404.   CheckOut -m file.c
  2405.  
  2406.   The above command checks out the latest revision of file.c for modification.
  2407.   The file is placed in the checkout directory for the project. If
  2408.   you already happen to have the latest revision of file.c in the checkout
  2409.   directory, then Projector only updates the 'ckid' resource of file.c
  2410.   to indicate that it is now a modifiable file.
  2411.  
  2412.   CheckOut -project Zoom∫Utilities∫Kerfroodi file.c,22
  2413.  
  2414.   The above command checks out a read-only copy of revision 22 of file.c
  2415.   from the Zoom∫Utilities∫Kerfroodi project. The file is placed in
  2416.   the checkout directory for the project.
  2417.  
  2418.   Project Zoom∫Utilities∫Kerfroodi
  2419.  
  2420.   CheckOut file.c -t "Fix Bug 7" -m -d "{Zoom}UtilitiesSrc:Kerfroodi"
  2421.  
  2422.   By setting the current project with the Project command you don’t
  2423.   need to specify a project on subsequent Projector commands. By setting
  2424.   the task other users will be able to see why you have checked out
  2425.   file.c. The files are placed in {Zoom}UtilitiesSrc:Kerfroodi.
  2426.  
  2427.   CheckOut -a -d HD:Work:Test
  2428.  
  2429.   The above example checks out read-only copies of all of the files
  2430.   in the current project and places the copies in the directory HD:work:Test.
  2431.  
  2432.   CheckOut -a -project Zoom∫ -r
  2433.  
  2434.   Checks out read-only copies of all files in the Zoom project and
  2435.   all of its subprojects. Its behavior is the same as if you had executed
  2436.   these commands individually:
  2437.  
  2438.   CheckOut -a -project Zoom∫
  2439.  
  2440.   CheckOut -a -project Zoom∫Voom
  2441.  
  2442.   CheckOut -a -project Zoom∫Utilities
  2443.  
  2444.   CheckOut -a -project Zoom∫Utilities∫MyProject
  2445.  
  2446.   ...
  2447.  
  2448.   You can conveniently update the read-only files (from the current
  2449.   project) in the current directory without affecting any files checked
  2450.   out for modification. To do this, use the -update option:
  2451.  
  2452.   CheckOut -update -d :
  2453.  
  2454.  
  2455.                              See also 
  2456.  
  2457.   CheckIn and CheckOutDir.
  2458.  
  2459. æKY CheckOutDir
  2460. æC  CheckOutDir -- specify the directory where checked out files will placed
  2461.  
  2462. CheckOutDir [-project project | -m] [-r] [-x | directory]
  2463.  -project project # name of project to associate with the checkout directory
  2464.  -m               # list the checkout directories of all root projects
  2465.  -r               # recursively set or display the checkout directories
  2466.  -x               # reset the checkout directories to ":"
  2467.  
  2468. Status codes returned:
  2469.   0    No errors.
  2470.   1    Syntax error.
  2471.   2    Error in processing.
  2472.   3    System error.
  2473.  
  2474.                            Description
  2475.  
  2476.   Under Projector, CheckOutDir changes the checkout directory associated
  2477.   with the current project to the HFS pathname directory. From this
  2478.   point on, files checked out of the named project are placed, by default,
  2479.   into this directory. The directory is created if it does not exist.
  2480.   When a project is mounted, the checkout directory is initially set
  2481.   to ":"—that is, the current directory.
  2482.  
  2483.   It is recommended that you put CheckOutDir commands immediately following
  2484.   the corresponding MountProject commands you place in your UserStartup
  2485.   file, script, or AddMenu for project initialization.
  2486.  
  2487.   If directory is missing, the checkout directory of the current project
  2488.   is written to standard output in the form of a CheckOutDir command.
  2489.  
  2490.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  2491.   symbols used in Projector commands.
  2492.  
  2493.  
  2494.                              Examples
  2495.  
  2496.   CheckOutDir HD:work:Test
  2497.  
  2498.   This command causes subsequent files in the current project to be
  2499.   checked out to the HD:work:Test folder.
  2500.  
  2501.   CheckOutDir
  2502.  
  2503.   CheckOutDir -project Zoom∫Utilities∫Test HD:work:Test
  2504.  
  2505.   The above command outputs the checkout directory of the current project
  2506.   in the form of a CheckOutDir command.
  2507.  
  2508.   CheckOutDir -project Zoom∫ -r
  2509.  
  2510.   CheckOutDir -project Zoom∫ :
  2511.  
  2512.   CheckOutDir -project Zoom∫Vroom :
  2513.  
  2514.   CheckOutDir -project Zoom∫Utilities :
  2515.  
  2516.   CheckOutDir -project Zoom∫Utilities∫Test HD:work:Test
  2517.  
  2518.   The -r option lets you display the checkout directory for the current
  2519.   project and all subprojects. In this case, only the sort project
  2520.   has a checkout directory setting that differs from the default.
  2521.  
  2522.   The -r option can also be used to set the checkout directories of
  2523.   a complex project to mirror the projects own hierarchical structure.
  2524.   For example:
  2525.  
  2526.   CheckOutDir -project Zoom∫ -r HD:Work:
  2527.  
  2528.   After executing the above command, listing the checkout directories
  2529.   for the projects under Zoom yields
  2530.  
  2531.   CheckOutDir -project Zoom∫ -r
  2532.  
  2533.   CheckOutDir -project Zoom∫ HD:work:
  2534.  
  2535.   CheckOutDir -project Zoom∫Vroom HD:Work:Vroom
  2536.  
  2537.   CheckOutDir -project Zoom∫Utilities HD:Work:Utilities
  2538.  
  2539.   CheckOutDir -project Zoom∫Utilities∫Test HD:Work:Utilities:Test
  2540.  
  2541.   Notice how the directory structure is similar to the project structure.
  2542.   The directories are created if they do not exist.
  2543.  
  2544.   The -m option lists the checkout directories of the root projects.
  2545.   For example
  2546.  
  2547.   CheckOutDir -m
  2548.  
  2549.   CheckOutDir -project Zoom∫ HD:Work:Zoom
  2550.  
  2551.   CheckOutDir -project Test∫ HD:Test
  2552.  
  2553.  
  2554.                              See also 
  2555.  
  2556.   MountProject, CheckIn, and CheckOut.
  2557.  
  2558. æKY Choose
  2559. æC   Choose -- choose or list network file server volumes and printers
  2560.  
  2561. Choose [option…] [[zone]:server[:volume] …]
  2562.  -askpw                # ask for server password (in a "safe" dialog box)
  2563.  -askvp                # ask for volume password (in a "safe" dialog box)
  2564.  -c                    # output in the form of further "Choose" commands.
  2565.  -cp                   # print driver name and type of current printer.
  2566.  -dr driverFileName    # name of printer driver file in system folder 
  2567.                        # (e.g. "LaserWriter")
  2568.  -guest                # log-in to the file server as a guest.
  2569.  -list                 # list entities (don't choose them).
  2570.  -p                    # print version information.
  2571.  -pr                   # choose printers (instead of file servers).
  2572.  -pw password          # specify server log-in password.
  2573.  -u username           # specify user name for server log-in.
  2574.  -v                    # verbose (print names of volumes really mounted).
  2575.  -vp volumePassword    # specify volume password (to mount it).
  2576.  -type type            # specify type of entity to list or choose (or '≈').
  2577.  
  2578.  Names take the form     "zone:server:volume"
  2579.  
  2580.  The wildcard '≈' may be used in place of a zone, server, volume or
  2581.  type name.  A leading ':' (empty zone name) or '*:' indicates the
  2582.  current zone.  A name of the form "…server:" will mount all volumes
  2583.  on the server, unless a specific volume name is given.
  2584.  
  2585. Status codes returned:
  2586.   0    No errors.
  2587.   1    Syntax error on command line.
  2588.   3    Any other error.
  2589.  
  2590.                            Description
  2591.  
  2592.   Choose noninteractively mounts or lists the specified AppleShare
  2593.   volumes or printers. Each name takes the form
  2594.  
  2595.   [zone]:[server[:volume]]
  2596.  
  2597.   ("Server" means any file or printer server.) The zone name is always
  2598.   optional and defaults to the current zone. A server name must be
  2599.   preceded by (at least) a colon. Volume names are only applicable
  2600.   to file servers.
  2601.  
  2602.   When mounting file server volumes, a server name is required. If
  2603.   a volume name is specified, only that volume is mounted. If the volume
  2604.   name is omitted, or if it is the wildcard character "≈", all volumes
  2605.   on the server are mounted:
  2606.  
  2607.   [zone]:server:volume
  2608.  
  2609.   [zone]:server[:≈]
  2610.  
  2611.   When -list is specified, the wildcard character "≈" may be used in
  2612.   place of names in all of the fields: "≈" in the zone field expands
  2613.   to all zones; "≈" in the server field expands to all servers in the
  2614.   specified zones; "≈" in the volume-name field expands to volumes
  2615.   on the specified servers (listing volumes on a server requires a
  2616.   server login—that is, as a user with a valid password or as a guest).
  2617.   If the wildcard character "≈" is used, it must be quoted so that
  2618.   the Shell will not expand it.
  2619.  
  2620.   The -list option also expands the next unspecified item in a name.
  2621.   A zone name followed by nothing else expands to a list of servers
  2622.   in that zone, and a server name followed by nothing else expands
  2623.   to a list of volumes on the server.
  2624.  
  2625.   If a "≈", ":" or "" character appears in a server, volume, or zone
  2626.   name, it may be quoted with the character "". This quoting mechanism
  2627.   supplements quoting already performed by the Shell.
  2628.  
  2629.   Any number of volumes may be mounted (though a system-dependent limit
  2630.   exists on the number of active server connections). Only one printer
  2631.   may be chosen at a time, since only one printer can be active.
  2632.  
  2633.   Server and volume passwords are case sensitive. More than one server
  2634.   and volume may be mounted with a single command, but the server and
  2635.   volume passwords must be the same for each, since at most one password
  2636.   of each type may be specified on the command line.
  2637.  
  2638.  
  2639.                              Examples
  2640.  
  2641.   Choose :Linker:Sources
  2642.  
  2643.   Mount the volume Sources on the server Linker, located in the current
  2644.   zone, using the default user name, server password, and volume password.
  2645.  
  2646.   Choose -v -guest 'Systems:Sources:Doc' 'Systems:Games:≈'
  2647.  
  2648.   Mount the volume Doc on the server Sources and every volume on the
  2649.   server Games in the zone Systems as a guest. Print the names of the
  2650.   volumes that are mounted by the command. List the names of all zones.
  2651.   Notice that the wildcard character "≈" is quoted.
  2652.  
  2653.   Choose -list 'Whale Zone:≈' 'Whale Zone:Moby Dick:≈' '≈:'
  2654.  
  2655.   List all file servers in the zone Whale Zone, all volumes on the
  2656.   file server Moby Dick in that zone (after logging in with the default
  2657.   user name and server password) and all zones (with their servers).
  2658.  
  2659.   Choose -pr -list ':≈'
  2660.  
  2661.   Choose -cp -pr Zarf:Kitchen Sink
  2662.  
  2663.   List all printers of the current type in the current zone. Print
  2664.   the name of the currently selected printer, then select the printer
  2665.   called Kitchen Sink in the zone Zarf.
  2666.  
  2667.   Choose -list -type Fortune Cookie Server '≈:≈'
  2668.  
  2669.   List all network entities of type Fortune Cookie Server in all zones.
  2670.  
  2671.  
  2672.                              See also 
  2673.  
  2674.   Unmount and Volumes commands.
  2675.  
  2676.  
  2677.  
  2678. æKY Clear
  2679. æC                     Clear -- clear the selection
  2680.  
  2681. Clear [-c count] selection [window]
  2682.  -c count                # repeat the Clear count times
  2683.  
  2684. Status codes returned:
  2685.   0    At least one instance of selection was found.
  2686.   1    Syntax error.
  2687.   2    Any other errors.
  2688.  
  2689.                            Description
  2690.  
  2691.   Finds selection and deletes its contents. The selection is not copied
  2692.   to the Clipboard. (For a definition of selection, see Chapter 6 of the
  2693.   MPW manual.)
  2694.  
  2695.   If window is specified, the Clear command acts on that window. It’s
  2696.   an error to specify a window that doesn’t exist. If no window is
  2697.   specified, the command operates on the target window (the second
  2698.   window from the front).
  2699.  
  2700.  
  2701.                              Examples
  2702.  
  2703.   Clear §
  2704.  
  2705.   Deletes the current selection. This is like the Clear command in
  2706.   the menu bar, except that the action occurs in the target window
  2707.   rather than the active window.
  2708.  
  2709.   Clear /BEGIN/:/END/
  2710.  
  2711.   Selects everything from the next BEGIN through the following END,
  2712.   and deletes the selection.
  2713.  
  2714.  
  2715.                              See also 
  2716.  
  2717.   Cut and Replace commands.
  2718.  
  2719.   "Selections" in Chapter 6 (see Appendix B for a summary).
  2720.  
  2721. æKY Close
  2722. æC                   Close -- close specified windows
  2723.  
  2724. Close [-y | -n | -c] [ -a | window…]
  2725.  -y                  # save modified windows before closing (avoids dialog)
  2726.  -n                  # don't save any modified windows (avoids dialog)
  2727.  -c                  # cancel if there is a modified window (avoids dialog)
  2728.  -a                  # close all the windows
  2729.  
  2730. Status codes returned:
  2731.   0    No errors.
  2732.   1    Syntax error 
  2733.   2    Any other error, such as "Window not found."
  2734.   4    Cancelled from dialog.
  2735.  
  2736.                            Description
  2737.  
  2738.   Close the window or windows specified by window. If no window is
  2739.   specified, the target window is closed. If changes to the window
  2740.   have not been saved, a dialog box requests confirmation of the Close
  2741.   command. In scripts you can use the -y, -n, or -c option to avoid
  2742.   this interaction. Use the -a option instead of window to close all
  2743.   of the open windows (other than the Worksheet).
  2744.  
  2745.  
  2746.                              Examples
  2747.  
  2748.   Close
  2749.  
  2750.   Closes the target window, prompting the user with a confirmation
  2751.   dialog box if needed.
  2752.  
  2753.   Close -a -y
  2754.  
  2755.   Saves and closes all open windows.
  2756.  
  2757.   Close -n Test.a Test.r
  2758.  
  2759.   Closes the windows Test.a and Test.r without saving any of the changes.
  2760.  
  2761.  
  2762.                              See also 
  2763.  
  2764.   "File Menu" in Chapter 3.
  2765.       
  2766. æKY CMarker
  2767. æC          CMarker -- generate Mark commands for C and C++ function definitions
  2768.                      
  2769. CMarker [option…] [file…]
  2770.  -a[nachronisms]         # suppress anachronisms messages
  2771.  -d[efine] name[=string] # define name to the preprocessor (same as #define)
  2772.      [,name[=string]]… 
  2773.  -e                      # show macro expansion in the listing (default with -ppout)
  2774.  -ext[ensions] on|off    # turn on or off Apple compiler extensions (default on)
  2775.  -errors                 # suppress marking if errors are detected
  2776.  -i[ncludes] pathname    # search for include files in the specified directories (Max of 15)
  2777.      [,pathname],… 
  2778.  -lang[uage] C|"C++"     # specify target sources as either C or C++ (Default is C)
  2779.  -linesize n             # maximum number of characters generated in a single listing line
  2780.  -l[ist[ing]]            # generate a listing of the source to stdout
  2781.  -mc68881                # define the macro name mc68881 as having the value 1
  2782.  -msi                    # mark include (header) files
  2783.  -pp                     # preprocessing only (no markers will be generated)
  2784.  -ppout filename         # write the preprocessor output to the specified filename
  2785.  -p[rogress]             # write version, progress and summary information to stderr
  2786.  -showskipped            # show lines skipped by conditional compilation in the listing output
  2787.  -t                      # display processing time and number of lines to stderr
  2788.  -u[ndefine] name        # undefine the preprocessor symbol name  (same as #undef)
  2789.     [,name]…
  2790.  
  2791. Status codes returned:
  2792.    0   No errors.
  2793.    1   Parameter or option error.
  2794.    2   Execution error.
  2795.    3   Syntax errors.
  2796.    
  2797.                            Description
  2798.  
  2799. CMarker reads the specified C++/ANSI C source file(s), syntax checks them and 
  2800. generates appropriate "Open" and "Mark" MPW commands, which, when executed, 
  2801. will mark the source file(s) at each function definition with the marker name being the 
  2802. name of the function.  It's purpose is to aid in the marking of source files for use with 
  2803. the MPW "marker browser" capability.  CMarker contains a full ANSI C preprocessor 
  2804. and provides options to mark include files, generate source listings (with or without 
  2805. showing macro expansions), run the preprocessor only, flag anachronisms, and syntax 
  2806. check C++/ANSI C with or without Apple extensions.  CMarker runs as an MPW Tool. 
  2807.  
  2808. æKY Commando
  2809. æC          Commando -- present a dialog interface for commands
  2810.  
  2811. Commando [command] [-modify]
  2812.     -modify                 # enable Commando’s built-in editor
  2813.  
  2814. Status codes returned:
  2815.   0    The Do It button was selected.
  2816.   1    The Cancel button was selected.
  2817.   2    Error occurred while parsing the cmdo resource.
  2818.   3    I/O or program error.
  2819.  
  2820.                            Description
  2821.  
  2822.   The Commando interface lets you operate any properly configured MPW
  2823.   tool or script using specialized Macintosh dialog boxes instead of
  2824.   the ordinary command line method. The dialogs make it easy to find
  2825.   options and build up complex command lines.
  2826.  
  2827.   Commands with many options and parameters may employ one or more
  2828.   nested dialog boxes. See "Commando Dialogs" in Chapter 4 of the MPW manual
  2829.   for more information on the basics of using the Commando dialogs. Chapter
  2830.   13 describes the structure of the Commando resource and shows how
  2831.   to create Commando dialogs for your own tools and scripts.
  2832.  
  2833.   The controls of a Commando dialog box, including text fields, buttons,
  2834.   titles, and so on, can be sized and moved within the dialog box by
  2835.   using the mouse, exactly as you would drag an object in the Finder.
  2836.   See "Editing Commando Dialogs" in Chapter 13 for information on moving
  2837.   and sizing controls.
  2838.  
  2839.  
  2840.                              Examples
  2841.  
  2842.   Commando Rez
  2843.  
  2844.   Displays the frontmost Rez dialog box shown under "Rez" in Part II.
  2845.  
  2846.   Rez…
  2847.  
  2848.   Displays the frontmost Rez dialog box shown under "Rez" in Part II,
  2849.   exactly as in the previous example.
  2850.  
  2851.  
  2852.                              See also 
  2853.  
  2854.   "Invoking Commando" in Chapter 4.
  2855.  
  2856.   Chapter 13.
  2857.  
  2858. æKY Compare
  2859. æC                    Compare -- compare text files
  2860.  
  2861. Compare [option…] file1 [file2]  < file2 > differences ≥ progress
  2862.  -b                      # treat several blanks or tabs as a single blank
  2863.  -c c1-c2[,c1-c2]        # compare only specified columns
  2864.  -d depth                # maximum stack depth
  2865.  -e context              # display specified number of context lines
  2866.  -g groupingFactor       # grouping factor (matching lines for resync)
  2867.  -h width                # write differences horizontally
  2868.  -l                      # lower case (i.e. ignore case differences)
  2869.  -m                      # suppress displays of mismatched lines 
  2870.  -n                      # don't write to output if files match
  2871.  -p                      # write progress information to diagnostics
  2872.  -s                      # use static grouping factor
  2873.  -t                      # ignore trailing blanks
  2874.  -v                      # suppress line numbers in vertical displays
  2875.  -x                      # don't expand tabs
  2876.  
  2877. Status codes returned:
  2878.   0    Files match.
  2879.   1    Parameter or option error.
  2880.   2    Files don’t match.
  2881.  
  2882.                            Description
  2883.  
  2884.   Compares the lines of two text files and writes their differences
  2885.   to standard output. Options are provided to compare a specific column
  2886.   range in each file
  2887.  
  2888.   (-c), to ignore blanks (-b), and to ignore case (-l).
  2889.  
  2890.   Both files are read and compared line for line. As soon as a mismatch
  2891.   is found, the two mismatched lines are stored in two stacks, one
  2892.   for each file. Lines are then read alternately (starting from the
  2893.   next input line in file2 ) until a match is found to put the files
  2894.   back in synchronization. If such a match is found, Compare writes
  2895.   the mismatched lines to standard output.
  2896.  
  2897.   Files are considered resynchronized when a certain number of lines
  2898.   in the two stacks exactly match. By default, the number of lines,
  2899.   called the grouping factor, is defined by the formula
  2900.  
  2901.   G = Trunc((2.0 * Log10(M)) + 2.0)
  2902.  
  2903.   where G is the grouping factor and M is the number of lines saved
  2904.   in each stack so far. This definition requires more lines to be the
  2905.   same after larger mismatches. Using this formula, the following table shows
  2906.   the grouping factor G as a function of the number of mismatched lines:
  2907.  
  2908.   M: Number of G: Grouping
  2909.  
  2910.   mismatched lines factor
  2911.  
  2912.   1 to 3 2
  2913.  
  2914.   4 to 9 3
  2915.  
  2916.   10 to 31 4
  2917.  
  2918.   32 to 99 5
  2919.  
  2920.   100 to 315 6
  2921.  
  2922.   316 to 999 7
  2923.  
  2924.   1000 to 3161 8
  2925.  
  2926.   3162 to 9999 9
  2927.  
  2928.   With the default dynamic grouping, the -g option sets the lower limit
  2929.   for G (which must be at least 2, because the formula is always applied).
  2930.   The -s option lets you fix G as a static constant. A static G may
  2931.   be desirable under some circumstances, but may also resynchronize
  2932.   the files at undesirable points, especially if G is too small. It’s
  2933.   recommended that you use the default (dynamic G ) first; if the results
  2934.   aren’t satisfactory, try a higher minimum value of dynamic G (such
  2935.   as 3 or 4). If that is still unsatisfactory, try the static G option.
  2936.  
  2937.   With either option, there’s a limit on the depth of the stacks— that
  2938.   is, on how far out of synchronization the two files can get before
  2939.   they’re no longer worth comparing. For a dynamic G, the limit on
  2940.   the number of mismatched lines is 1000, but you can choose a lower
  2941.   limit with the -d option. For the static G option, typical values
  2942.   for G are 1 to 5, and the stack depth should be between about 10
  2943.   and 50 (the default limit is 25).
  2944.  
  2945.  
  2946.                              Examples
  2947.  
  2948.   Compare File File.bak > Mismatches
  2949.  
  2950.   Compares File and File.bak, writing the results to the file Mismatches.
  2951.   No options are specified, so dynamic grouping is used, blanks are
  2952.   retained, tabs are expanded into spaces, and matching is case sensitive.
  2953.  
  2954.   Compare File.old.§ File.new.§
  2955.  
  2956.   Compares the selected portions of the two windows and writes out
  2957.   the results.
  2958.  
  2959.   Limitations Compare can handle text files with a maximum line length
  2960.   of 255 characters.
  2961.  
  2962.   The text files compared should be fewer than 9999 lines long, because
  2963.   the displays are formatted based on four-digit line numbers.
  2964.  
  2965.  
  2966.                              See also 
  2967.  
  2968.   Equal command (Equal is a quicker command that tells you whether
  2969.   files are different, but stops at the first byte at which they differ).
  2970.  
  2971. æKY CompareFiles
  2972. æC  CompareFiles -- compare text files and interactively view differences
  2973.  
  2974. CompareFiles [-9 | -13 | -b x y | -Portrait | -TwoPage] oldFile newFile
  2975.  -9                      # assume a screen size of 512 x 342
  2976.  -13                     # assume a screen size of 640 x 480
  2977.  -b x y                  # tile windows into the rectangle specified by x y
  2978.  -Portrait               # screen size for Apple Macintosh Portrait Display
  2979.  -TwoPage                # screen size for Apple Two-Page Monochrome Monitor
  2980.  
  2981. Status codes returned:
  2982.   0    The files match.
  2983.   1    Syntax error.
  2984.   2    The files differ.
  2985.  
  2986.                            Description
  2987.  
  2988.   CompareFiles compares two text files (using the tool Compare) and,
  2989.   if there are any differences, displays the file in adjacent windows
  2990.   for interactively viewing the differences. A menu will be appended
  2991.   to the menu bar to go through the changes.
  2992.  
  2993.   When all the changes have been shown, the windows will be closed
  2994.   (if they were closed when CompareFiles started) and the menu will
  2995.   be deleted.
  2996.  
  2997.   The Compare menu contains four items for viewing and editing the
  2998.   differences. The items perform the following actions:
  2999.  
  3000.   Find Next Change Finds the next difference and highlights the changes
  3001.   in each window. (Notice that the differences are shown from bottom
  3002.   to top. This is so editing changes will not affect the file offsets
  3003.   recorded from the Compare tool.)
  3004.  
  3005.   Copy Selection »» Replaces the changed text in the new file with
  3006.   the old text.
  3007.  
  3008.   Copy Selection «« Replaces the old text with the changed text from
  3009.   the new file.
  3010.  
  3011.   Done Closes the files (asking if you want to save changes) and deletes
  3012.   the Compare menu. Use this item to close all the windows and delete
  3013.   the menu. (If you close any of the windows yourself, they will not
  3014.   be restored to their previous size and position.)
  3015.  
  3016.   The figure below shows the CompareFiles menu.
  3017.  
  3018.  
  3019.  
  3020.  
  3021.                              Examples
  3022.  
  3023.   CompareFiles Sample.old Sample.c
  3024.  
  3025.   Compares the file Sample.c to Sample.old. If there are some differences,
  3026.   those two files are opened side by side on the screen.
  3027.  
  3028.   CompareFiles -b 1024 1024 Sample.old Sample.c
  3029.  
  3030.   Compares the file Sample.c to Sample.old. If there are differences,
  3031.   the files are opened and tiled into a 1024 by 1024 rectangle.
  3032.  
  3033.  
  3034.                              See also 
  3035.  
  3036.   Compare Tool.
  3037.  
  3038. æKY CompareRevisions
  3039. æC   CompareRevisions -- compare two revisions of a file in a project
  3040. CompareRevisions file…
  3041.  
  3042. Status codes returned:
  3043.   0    No Errors.
  3044.   1    Syntax Error.
  3045.   2    Error in Processing.
  3046.   3    System Error.
  3047.  
  3048.                            Description
  3049.  
  3050.   Compare the revision of the HFS file file with another revision of
  3051.   that same file.
  3052.  
  3053.   CompareRevisions uses the ProjectInfo command to determine what project
  3054.   file belongs to and what its revision is. CompareRevisions then displays
  3055.   a list of the other revisions of the file for the user to choose.
  3056.   CompareRevisions checks this other revision out and calls the CompareFiles
  3057.   script to display both revisions on the screen and to highlight the
  3058.   differences between them. CompareFiles puts up an AddMenu named Compare
  3059.   to help you step through the differences between the two revisions.
  3060.  
  3061.   The file must belong to a currently mounted project. If the project
  3062.   that the file belongs to is not currently mounted, CompareRevisions
  3063.   displays an Alert.
  3064.  
  3065.   CompareRevisions uses the CompareFiles script.
  3066.  
  3067.  
  3068.                              Examples
  3069.  
  3070.   CompareRevisions file.c
  3071.  
  3072.   This example compares the revision in HFS file "file.c" in the working
  3073.   directory with any other revisions of file.c in the project.
  3074.  
  3075.   AddMenu Project 'Compare Revisions' 'CompareRevisions {Active} ∑∑ {WorkSheet}'
  3076.  
  3077.   This example adds CompareRevisions to the Project menu and allows
  3078.   you to compare revisions by opening the file you wish to compare
  3079.   and then selecting the 'Compare Revisions' menu item in the Project
  3080.   menu.
  3081.  
  3082.  
  3083.                              See also 
  3084.  
  3085.   CompareFiles.
  3086.  
  3087. æKY Confirm
  3088. æC             Confirm -- display a confirmation dialog box
  3089.  
  3090. Confirm [-t] [message…] < file
  3091.  -t                      # three buttons (Yes, No, Cancel)
  3092.  
  3093. Status codes returned:
  3094.   0    The OK button was selected.
  3095.   1    Syntax error.
  3096.   4    The Cancel button was selected or the No button was clicked in a three-way    dialog box.
  3097.   5    The Cancel button was selected in a three-way dialog box; see the -t option.
  3098.  
  3099.                            Description
  3100.  
  3101.   Confirm displays a confirmation dialog box with OK and Cancel buttons
  3102.   and the prompt message. There is no output to this command: the result
  3103.   of the dialog is returned in the {Status} variable.
  3104.  
  3105.   Note: Because Confirm returns a nonzero status value to indicate
  3106.   that No or Cancel was selected, a script should set the Shell variable
  3107.   {Exit} to zero before executing the Confirm command. (This step is
  3108.   necessary because the Shell aborts script processing when a nonzero
  3109.   status value is returned and {Exit} is nonzero.)
  3110.  
  3111.  
  3112.                              Examples
  3113.  
  3114.   Set Exit 0
  3115.   Confirm "Replace files with the same name? "
  3116.   If {Status} == 0
  3117.     Duplicate -y Source:≈ Destination:
  3118.   End
  3119.   Set Exit 1
  3120.  
  3121.   The following confirmation dialog box will be displayed:
  3122.  
  3123. æKY Continue
  3124. æC        Continue -- continue with next iteration of For or Loop
  3125.  
  3126. Continue [If expression]
  3127. Status codes returned:
  3128.    0   No errors.
  3129.   –3   Error in parameters, or Continue not within For…End or Loop…End.
  3130.   –5   Invalid expression.
  3131.  
  3132.                            Description
  3133.  
  3134.   If expression is nonzero, Continue terminates this iteration of the
  3135.   immediately enclosing For or Loop command and continues with the
  3136.   next iteration. (Null strings evaluate to zero.) If the "If expression"
  3137.   clause is omitted, the Continue is unconditional. If no further iterations
  3138.   are possible, the For or Loop is terminated. (For a definition of
  3139.   expression, see the Evaluate command.)
  3140.  
  3141.  
  3142.                              Examples
  3143.  
  3144.   Set Exit 0
  3145.   Set list ""
  3146.   For file In `files -t TEXT`
  3147.     Confirm -t "Print file {file}?"
  3148.     Set SaveStatus {Status}
  3149.     Continue If {SaveStatus} == 4 # No
  3150.     Break If {SaveStatus} == 5 # Cancel
  3151.     Set list "{list} '{file}'" # YesEnd
  3152.   End
  3153.   Print {PrintOptions} {list}
  3154.   Set Exit 1
  3155.  
  3156.   In this example, the Continue command is executed if the user selects
  3157.   No (status value 4). The Continue causes the current file to be skipped, but
  3158.   processing continues with the next file in the list.
  3159.  
  3160.   (For a full explanation of this example, refer to the Confirm command.)
  3161.  
  3162.  
  3163.                              See also 
  3164.  
  3165.   For, Loop, Break, and If commands.
  3166.  
  3167.   Evaluate command, for a description of expressions.
  3168.  
  3169.   "Structured Commands" in Chapter 5.
  3170.  
  3171. æKY Copy
  3172. æC                  Copy -- copy selection to Clipboard
  3173.  
  3174. Copy [-c count] selection [window]
  3175.  -c count                # copy the nth selection, where n = count
  3176.  
  3177. Status codes returned:
  3178.   0    At least one instance of the selection was found.
  3179.   1    Syntax error.
  3180.   2    Any other error.
  3181.  
  3182.                            Description
  3183.  
  3184.   Finds selection in the specified window and copies it to the Clipboard,
  3185.   replacing the previous contents of the Clipboard. If no window is
  3186.   specified, the command operates on the target window (the second
  3187.   window from the front). It’s an error to specify a window that doesn’t
  3188.   exist.
  3189.  
  3190.   For a definition of selection, see "Selections" in Chapter 6 of the MPW
  3191.   manual; a summary
  3192.   of the selection syntax is contained in Appendix B.
  3193.  
  3194.     • Note: To copy files, use the Duplicate command.
  3195.  
  3196.  
  3197.                              Examples
  3198.  
  3199.   Copy §
  3200.  
  3201.   Copies the current selection to the Clipboard. This command is like
  3202.   the Copy command in the Edit menu, except that the action takes place
  3203.   in the target window.
  3204.  
  3205.   Copy /BEGIN/:/END/
  3206.  
  3207.   Selects everything from the next BEGIN through the following END
  3208.   and copies this selection to the Clipboard.
  3209.  
  3210.  
  3211.                              See also 
  3212.  
  3213.   Cut and Paste commands.
  3214.  
  3215.   "Selections" in Chapter 6 and Appendix B.
  3216.  
  3217.  
  3218. æKY Count
  3219. æC                  Count -- count lines and characters
  3220.  
  3221. Count [-l] [-c] [file…]  < file > counts
  3222.  -l                      # write only line counts
  3223.  -c                      # write only character counts
  3224.  
  3225. Status codes returned:
  3226.   0    No errors.
  3227.   1    Error in parameters.
  3228.   2    Unable to open input file.
  3229.  
  3230.                            Description
  3231.  
  3232.   Counts the lines and characters in its input and writes the results
  3233.   to standard output. If no files are specified, standard input is
  3234.   read. If more than one file is specified, separate counts are printed
  3235.   for each file, one per line and preceded by the filename. A total
  3236.   is printed following the list.
  3237.  
  3238.  
  3239.                              Examples
  3240.  
  3241.   Count MakeFile.c Count.c
  3242.  
  3243.   Displays line counts and character counts in the form
  3244.  
  3245.   MakeFile.c 43 981
  3246.   Count.c 153 3327
  3247.   Total 196 4303
  3248.  
  3249.   Files | Count -l
  3250.  
  3251.   Displays the total number of files and directories in the current
  3252.   directory.
  3253.  
  3254.   Count -l §
  3255.  
  3256.   Displays the number of lines selected in the target window.
  3257.  
  3258.     • Note: The source code for Count is included in the CExamples
  3259.     folder in the file Count.c, as part of MPW C.
  3260.  
  3261. æKY CPlus
  3262. æC                CPlus -- script to compile C++ source
  3263.  
  3264. CPlus [option…] [file…] < file > intermediate output ≥ progress
  3265.     -a                      # force ANSI-style intermediate C code (default)
  3266.     -a0                     # force K&R-style (pre-ANSI) intermediate C code
  3267.     -a1                     # force ANSI-style intermediate C code (default)
  3268.     -b                      # put string constants into code and generate PC-relative references
  3269.     -b2                     # implies '-b' above, and allows string constants to be overlaid
  3270.     -b3                     # overlaid string constants in code (but not PC-relative refs.)
  3271.     -c                      # intermediate code to standard output; no object file
  3272.     -d name                 # equivalent to: #define name 1
  3273.     -d name=string          # equivalent to: #define name string
  3274.     -e                      # write preprocessor results to output
  3275.     -e2                     # implies '-e' above, and strips comments
  3276.     -elems881               # generate MC68881 code for transcendentals
  3277.     -f filename             # act as if input comes from named file when it actually is from stdin 
  3278.     -f1                     # send text version of C code to C compiler (no token stream)
  3279.     -i directory            # search for includes in directory
  3280.     -m                      # generate 32-bit references for data (less efficient code)
  3281.     -mbg ch8                # MPW 2.0 compatible macsbug symbols
  3282.     -mbg off                # no macsbug symbols in the code (link/unlk only if necessary)
  3283.     -mbg on|full            # full macsbug symbols
  3284.     -mbg <n>                # macsbug symbols to length <n> (<n> can be 0..63)
  3285.     -mc68020                # generate MC68020 code 
  3286.     -mc68881                # generate MC68881 code for arithmetic operations
  3287.     -mtbl0                  # suppress output of method tables for Object Pascal Classes
  3288.     -mtbl1                  # force output of method tables for Object Pascal Classes
  3289.     -n                      # Turn pointer assignment incompatibilty errors into warnings
  3290.     -o objname              # generate code in file or directory objname
  3291.     -p                      # write progress information to diagnostic
  3292.     -s segment              # generate code in segment
  3293.     -sym off                # no SADE records
  3294.     -sym on|full            # full SADE records; can modify with [,nolines] [,notypes] [,novars]
  3295.     -t                      # write C compilation time to diagnostic
  3296.     -u name                 # equivalent to: #undef name
  3297.     -vtbl0                  # suppress output of virtual tables for ordinary class
  3298.     -vtbl1                  # force output of virtual tables for ordinary class
  3299.     -vtbl2                  # new improved output algorithm for virtual tables
  3300.     -w                      # suppress warnings
  3301.     -w1                     # generate additional warnings from CFront
  3302.     -w3                     # passed through to C compiler (supresses unused warnings)
  3303.     -y directory            # create temporary files in directory
  3304.     -z0                     # force 'inline' functions to be non-inline
  3305.     -z3                     # supress name encoding of local vars and struct members (default)
  3306.     -z4                     # encode names of local vars and struct members
  3307.     -z6                     # force enums always to be int variables
  3308.     -z7                     # relax requirement on static class member initialization 
  3309.  
  3310. Status codes returned:
  3311.   0    Successful completion.
  3312.   1    Errors occurred.
  3313.  
  3314.                            Description
  3315.  
  3316.   CPlus compiles the specified C++ source file. Compiling file Name.cp
  3317.   creates object file Name.cp.o. (By convention, C++ source filenames
  3318.   end in a ".cp" suffix.) If no filenames are specified, standard input
  3319.   is compiled and the object file "c.o" is created.
  3320.  
  3321.   (Note that SADE object file information cannot be generated for standard
  3322.   input source files.)
  3323.  
  3324.   The CPlus script activates, in turn, CFront, and the MPW C Compiler.
  3325.   (CFront consists of two components: a C preprocessor and a C++ to
  3326.   C translator.)
  3327.  
  3328.   See the MPW 3.0 C++ Reference Manual for details of the MPW C++ language
  3329.   definition.
  3330.  
  3331.  
  3332.                              Examples
  3333.  
  3334.   cplus -p Sample.c
  3335.  
  3336.   Compiles Sample.c, producing the object file Sample.c.o. Writes progress
  3337.   information to diagnostic output. (Sample.c is found in Examples:CPlusExamples.)
  3338.  
  3339.  
  3340.                              See also 
  3341.  
  3342.   MPW 3.0 C Reference, MPW C++ Reference.
  3343.  
  3344. æKY CreateMake
  3345. æC                CreateMake -- create a simple makefile
  3346.  
  3347. CreateMake ([ -Application] [ -c creator ] [-sym on] | -Tool [-sym on] | 
  3348.                 -DA | -CR -m mainEntryPoint -rt resourceType [ -t fileType ] 
  3349.                 [ -c creator ] [-sym on] | -SIOW [ -sym on ]) 
  3350.                 [ -mc68020 | -mc68881 | -elems881] program file…
  3351.     -Application        # create an Application (default)
  3352.     -c creator          # optional Creator for Application or Code Resource
  3353.     -Tool               # create a Tool
  3354.     -DA                 # create a Desk Accessory
  3355.     -CR                 # create a Code Resource
  3356.     -SIOW               # create a Simple Input/Output Window
  3357.     -m mainEntryPoint   # required Main Entry Point for Code Resource
  3358.     -rt resourceType    # required Resource Type for Code Resource
  3359.     -t type             # optional File Type for Code Resource
  3360.     -sym on             # include SADE information in the object file
  3361.     -mc68020            # generate 68020 instructions
  3362.     -mc68881            # generate 68881 instructions for elementary operations
  3363.     -elems881           # generate 68881 instructions for transcendental functions
  3364.  
  3365. Status codes returned:
  3366.   0    Successful completion.
  3367.   1    Parameter or option error.
  3368.  
  3369.                            Description
  3370.  
  3371.   CreateMake creates a simple makefile for building the specified program.
  3372.   The parameter program is the name of the program. Makefile program.make
  3373.   is created. The list of files includes both source and library files.
  3374.   Source files may be written in any combination of assembly language
  3375.   (suffix ".a"), C (".c"), C++ (".cp"), Pascal (".p"), and/or Rez (".r").
  3376.  
  3377.   You can also specify Library files (suffix ".o"). Link the program
  3378.   with these files. CreateMake automatically links with the library
  3379.   files listed below. It is not necessary to specify these files as
  3380.   parameters to CreateMake.
  3381.  
  3382.   You can create Makefiles for building applications (the default),
  3383.   desk accessories, and tools.
  3384.  
  3385.   CreateMake generates commands that link the program with the following
  3386.   set of MPW libraries:
  3387.  
  3388.     • Inside Macintosh Interfaces
  3389.         {Libraries}Interface.o
  3390.     • Runtime support—one of the following:
  3391.         {Libraries}Stubs.o # a tool is to be built
  3392.         {Libraries}Runtime.o # no C object files
  3393.         {CLibraries}CRuntime.o # any C object files
  3394.     • C Libraries—if any source is in C
  3395.         {CLibraries}StdCLib.o
  3396.         {CLibraries}CSANELib.o
  3397.         {CLibraries}Math.o
  3398.         {CLibraries}CInterface.o
  3399.     • C Libraries—if any source is in C++
  3400.         {CLibraries}CPlusStreams.o # a tool is to be built
  3401.         {CLibraries}CPlusStubs.o # a DA is to be built
  3402.         {CLibraries}CSANELib.o
  3403.         {CLibraries}Math.o
  3404.         {CLibraries}CInterface.o
  3405.     • Pascal Libraries—if any source is in Pascal
  3406.         {PLibraries}PasLib.o
  3407.         {PLibraries}SANELib.o
  3408.     • For tools:
  3409.         {Libraries}ToolLibs.o
  3410.     • For desk accessories:
  3411.         {Libraries}DRVRRuntime.o
  3412.  
  3413.   CreateMake does not include dependencies on include files and USES
  3414.   files in the makefile. Libraries other than those listed above are
  3415.   not included in the Link command generated by CreateMake, unless
  3416.   specified as parameters. CreateMake is used to implement the Create
  3417.   Build Commands item in the Build menu.
  3418.  
  3419.  
  3420.                              Examples
  3421.  
  3422.   CreateMake -tool count count.c count.r
  3423.  
  3424.   Creates the makefile Count.make containing commands for building
  3425.   the tool Count from the source files Count.c and Count.r. The makefile
  3426.   is similar to the following:
  3427.  
  3428.   # File: count.make
  3429.   # Target: count
  3430.   # Sources: count.c count.r
  3431.   # Created: Thursday, June 2, 1988 5:33:38 PM
  3432.  
  3433.   count.c.o ƒ count.make count.c
  3434.       C count.c
  3435.  
  3436.   count ƒƒ count.make count.r
  3437.       Rez count.r -append -o count
  3438.  
  3439.   SOURCES = count.c count.r
  3440.   OBJECTS = count.c.o
  3441.  
  3442.   count ƒƒ count.make {OBJECTS}
  3443.  
  3444.       Link -w -t MPST -c ‘MPS ’ ∂
  3445.           "{Libraries}"Stubs.o ∂
  3446.           "{CLibraries}"CRuntime.o ∂
  3447.           "{Libraries}"Interface.o ∂
  3448.           "{CLibraries}"StdCLib.o ∂
  3449.           "{CLibraries}"CSANELib.o ∂
  3450.           "{CLibraries}"Math.o ∂
  3451.           "{CLibraries}"CInterface.o ∂
  3452.           "{Libraries}"ToolLibs.o ∂
  3453.           "{OBJECTS}" ∂
  3454.           -o count
  3455.  
  3456.  
  3457.                              See also 
  3458.  
  3459.   BuildMenu and BuildProgram commands.
  3460.  
  3461.   "Building a Program: An Introduction" in Chapter 2.
  3462.  
  3463.  
  3464. æKY Cut
  3465. æC           Cut -- copy selection to Clipboard and delete it
  3466.  
  3467. Cut [-c count] selection [window]
  3468.  -c count                # cut the next count selections
  3469.  
  3470. Status codes returned:
  3471.   0    At least one instance of the selection was found.
  3472.   1    Syntax error.
  3473.   2    Any other error.
  3474.  
  3475.                            Description
  3476.  
  3477.   Finds selection in the specified window, copies its contents to the
  3478.   Clipboard, and then deletes the selection. If no window is specified,
  3479.   the command operates on the target window (the second window from
  3480.   the front). It’s an error to specify a window that doesn’t exist.
  3481.  
  3482.   For a definition of selection, see "Selections" in Chapter 6 of the MPW
  3483.   manual; a summary of the selection syntax is contained in Appendix B.
  3484.  
  3485.  
  3486.                              Examples
  3487.  
  3488.   Cut §
  3489.  
  3490.   Cuts the current selection in the target window. (This is the same
  3491.   as the Cut menu item, except that it operates on the target window
  3492.   rather than the active window.)
  3493.  
  3494.   Cut /BEGIN/:/END/
  3495.  
  3496.   Selects everything from the next BEGIN through the following END,
  3497.   copies the contents of the selection to the Clipboard, and then deletes
  3498.   the selection.
  3499.  
  3500.  
  3501.                              See also 
  3502.  
  3503.   Clear, Copy, and Paste commands.
  3504.  
  3505.   "Selections" in Chapter 6 and in Appendix B.
  3506.  
  3507. æKY Date
  3508. æC                    Date -- write the date and time
  3509.  
  3510. Date ([-a | -s] [-d | -t] [-c seconds]) | [-n] > date
  3511.   -a                       # abbreviated date (e.g. Wed, Jun 18, 1986)
  3512.   -s                       # short date (e.g. 6/18/86)
  3513.   -d                       # write date only
  3514.   -t                       # write time only
  3515.   -c seconds               # write date corresponding to seconds
  3516.   -n                       # write seconds since January 1, 1904
  3517.  
  3518. Status codes returned:
  3519.   0    No error.
  3520.   1    Syntax error.
  3521.  
  3522.                            Description
  3523.  
  3524.   Writes the current date and time to standard output in a variety
  3525.   of standard and user-specified formats. Date arithmetic is supported
  3526.   with the -n and -c options that work with the number of seconds since
  3527.   January 1, 1904. With no options the Date output has this form: Thursday,
  3528.   August 30, 1988 10:45:51 A.M.
  3529.  
  3530.  
  3531.                              Examples
  3532.  
  3533.   Date
  3534.  
  3535.   returns the date in the form
  3536.   Friday, February 14, 1988 10:34:25 PM
  3537.  
  3538.   Date -a
  3539.  
  3540.   returns
  3541.   Fri, Feb 14, 1988 10:34:25 PM
  3542.  
  3543.   Date -s -d
  3544.  
  3545.   returns
  3546.   2/14/86
  3547.  
  3548.   Set starttime `Date -n`
  3549.   BuildMyProgram
  3550.   Set endTime `Date -n`
  3551.   Echo Total time for BuildMyProgram ∂
  3552.   `Evaluate {endTime} - {startTime}`
  3553.  
  3554.   This example demonstrates how date arithmetic may be used to show
  3555.   how long a tool or script takes to execute.
  3556.  
  3557. æKY Delete
  3558. æC                Delete -- delete files and directories
  3559.  
  3560. Delete [-y | -n | -c] [-i] [-p] name…  ≥ progress
  3561.  -y                # delete directory contents (avoids dialog)
  3562.  -n                # don't delete directory contents (avoids dialog)
  3563.  -c                # cancel if a directory is to be deleted (avoids dialog)
  3564.  -i                # ignore errors (no diagnostics)
  3565.  -p                # write progress information to diagnostics
  3566.   
  3567. Status codes returned:
  3568.   0    All specified objects were deleted (except for any directories skipped 
  3569.        with the -n option).
  3570.   1    Syntax error.
  3571.   2    An error occurred during the delete.
  3572.   4    Cancel was selected or implied by the -c option.
  3573.  
  3574.                            Description
  3575.  
  3576.   Deletes file or directory name. If name is a directory, name and
  3577.   its contents (including all subdirectories) are deleted.
  3578.  
  3579.   Before deleting directories, a dialog box will request confirmation
  3580.   for the deletion. Use the -y, -n, or -c options in scripts to avoid
  3581.   this interaction. Be sure to see the warning at the end of this section.
  3582.  
  3583.  
  3584.                              Examples
  3585.  
  3586.   Delete HD:MPW:≈.c
  3587.  
  3588.   Deletes all items in the MPW folder that end in ".c". (Recall that
  3589.   the Shell first replaces the parameter "≈.c" with a list of filenames
  3590.   matching the pattern—the Delete command then deletes each of these
  3591.   files.)
  3592.  
  3593.   Warning Beware of potentially disastrous typographical mistakes such
  3594.   as the following:
  3595.  
  3596.   Delete ≈ .c
  3597.  
  3598.   Note the space after "≈"—this space causes "≈" and ".c" to be treated
  3599.   as two separate parameters. In this case, Delete deletes all files
  3600.   in the current directory and also attempts to delete a file named
  3601.   ".c".
  3602.  
  3603.   Also note that the following command deletes everything:
  3604.  
  3605.   Delete ≈:
  3606.  
  3607.   That is, the filename pattern ≈: expands to the names of all volumes
  3608.   online (including the startup volume!).
  3609.  
  3610.   When deleting files en masse, it’s a good practice to use the Echo
  3611.   command to verify the action of the filename generation operators;
  3612.   for example,
  3613.  
  3614.   Echo ≈.c
  3615.  
  3616.  
  3617.                              See also 
  3618.  
  3619.   Clear command (for deleting selections).
  3620.  
  3621.   "Filename Generation" in Chapter 5.
  3622.  
  3623. æKY DeleteMenu
  3624. æC        DeleteMenu -- delete user-defined menus and menu items
  3625.  
  3626. DeleteMenu [menuName [itemName]]
  3627.  
  3628. Status codes returned:
  3629.   0    No errors.
  3630.   1    Syntax error.
  3631.   2    Other errors.
  3632.  
  3633.                            Description
  3634.  
  3635.   Deletes the user-defined item itemName in the menu menuName. If itemName
  3636.   is omitted, all user-defined items for menuName are deleted.
  3637.  
  3638.   Caution If itemName and menuName are both omitted, all user-defined
  3639.   items are deleted. Menu items that haven’t been added with AddMenu
  3640.   can’t be deleted with DeleteMenu.
  3641.  
  3642.  
  3643.                              Examples
  3644.  
  3645.   DeleteMenu File
  3646.  
  3647.   Deletes all user-defined items from the File menu.
  3648.  
  3649.  
  3650.                              See also 
  3651.  
  3652.   AddMenu command. 
  3653.  
  3654. æKY DeleteNames
  3655. æC           DeleteNames -- delete user-defined symbolic names
  3656.  
  3657. DeleteNames [-u user] [-private] [-project project] [-public] [-r] [names… | -a]
  3658.   -u user                 # name of current user
  3659.   -private                # delete private names
  3660.   -project project        # name of project that contains the files
  3661.   -public                 # delete public names
  3662.   -r                      # delete names recursively
  3663.   -a                      # delete all names
  3664.  
  3665. Status codes returned:
  3666.   0    No errors.
  3667.   1    Syntax error.
  3668.   2    Error in processing.
  3669.  
  3670.                            Description
  3671.  
  3672.   Delete symbolic names used to represent a set of revisions under
  3673.   Projector. You can create symbolic names by using the NameRevisions
  3674.   command.
  3675.  
  3676.   You can use the -log option of the ProjectInfo command to see which
  3677.   names have been deleted and what their values were.
  3678.  
  3679.   See Chapter 7 of MPW Manual for complete definitions of the terms and 
  3680.   symbols used in Projector commands.
  3681.  
  3682.  
  3683.                              Examples
  3684.  
  3685.   Suppose you have created a Name "Work" that is expanded to the
  3686.   files file.c and interactive.c using the command
  3687.  
  3688.   NameRevisions Work file.c interactive.c
  3689.  
  3690.   Then:
  3691.  
  3692.   DeleteNames Work
  3693.  
  3694.   removes "Work" from the list of symbolic names.
  3695.  
  3696.  
  3697.                              See also 
  3698.  
  3699.   NameRevisions, ProjectInfo.
  3700.  
  3701.  
  3702. æKY DeletePane
  3703. æC                          DeletePane --  delete panes from the window
  3704.  
  3705. DeletePane [-p paneSpec | -a] [window]
  3706.      -p paneSpec            # choose a  pane to delete
  3707.      -a                     # reset the window to one pane
  3708.  
  3709.       Note: paneSpec is an alternating catenation of strings of the 
  3710.       form cm and rn, where m is a column ordinal and n is a row ordinal.
  3711.  
  3712.  
  3713. æKY DeleteRevisions
  3714. æC  DeleteRevisions -- delete previous revisions of files in a project
  3715.  
  3716. DeleteRevisions [-u user] [-project project] [-file] [-y] revision…
  3717.     -u user                 # name of current user
  3718.     -project project        # name of project that contains the files
  3719.     -file                   # deletes the file and all its revisions
  3720.     -y                      # delete the file/revision (avoids dialog)
  3721.  
  3722. Status codes returned:
  3723.   0    No errors.
  3724.   1    Syntax error.
  3725.   2    Error in processing.
  3726.   3    System error.
  3727.  
  3728.                            Description
  3729.  
  3730.   Delete old revisions by specifying the oldest revision that you want
  3731.   to keep. All prior revisions are deleted. Delete all revisions on
  3732.   a branch by naming the branch or branches in the named files under
  3733.   Projector. It is an error to try to delete a revision that is currently
  3734.   checked out for modification.
  3735.  
  3736.   Revision is either a filename, a filename followed by a comma and
  3737.   a revision number, or a filename followed by a comma and a branch
  3738.   name (such as
  3739.  
  3740.   foo.c,22a).
  3741.  
  3742.   You can use the -file option to remove the file and all of its revisions
  3743.   from the project.
  3744.  
  3745.   s Warning DeleteRevisions permanently removes the revisions and branches
  3746.   specified. They cannot be recovered.  s
  3747.  
  3748.   You can use the -log option of the ProjectInfo command to see which
  3749.   revisions have been deleted and who deleted them.
  3750.  
  3751.   See Chapter 7 of the MPW Manual for complete definitions of the terms and 
  3752.   symbols used in Projector commands.
  3753.  
  3754.  
  3755.                              Examples
  3756.  
  3757.   DeleteRevisions -project Zoom∫Utilities∫MyProject file.c
  3758.  
  3759.   This example deletes all revisions except the latest in file.c in
  3760.   the named project.
  3761.  
  3762.   DeleteRevisions file.c,22a3
  3763.  
  3764.   This example deletes all revisions on branch 22a before revision
  3765.   3 of file.c.
  3766.  
  3767.   DeleteRevisions file.c,22a
  3768.  
  3769.   This command deletes all the revisions on branch 22a in file.c of
  3770.   the current project.
  3771.  
  3772.   DeleteRevisions -file file.c
  3773.  
  3774.   This command deletes the file file.c and all of its revisions from
  3775.   the current project.
  3776.  
  3777.  
  3778.                              See also 
  3779.  
  3780.   NameRevisions, ProjectInfo.
  3781.  
  3782. æKY DeRez
  3783. æC                     DeRez -- resource decompiler
  3784.  
  3785. DeRez [option…] resourceFile [file…]  > description ≥ progress
  3786.     -c[ompatible]           # generate output compatible with Rez 1.0
  3787.     -e[scape]               # don't escape chars < $20 or > $D8
  3788.     -d[efine] name[=value]  # equivalent to #define name [value]
  3789.     -i[nclude] pathname     # search this path when looking for #include files
  3790.     -m[axstringsize] n      # write strings n characters per line
  3791.     -only typeExpr          # process only resources of this type
  3792.     -p[rogress]             # write progress information to diagnostics
  3793.     -rd                     # suppress warnings for redeclared types
  3794.     -s[kip] typeExpr        # skip resources of this type
  3795.     -u[ndef] name           # equivalent to #undef name
  3796.  
  3797.     Note: A typeExpr may have one of these forms:
  3798.           type
  3799.         "'type'(id)"
  3800.         "'type'(id:id)"
  3801.         "'type'(∂"name∂")"
  3802.  
  3803. Status codes returned:
  3804.   0    No errors.
  3805.   1    Error in parameters.
  3806.   2    Syntax error in file.
  3807.   3    I/O or program error.
  3808.  
  3809.                            Description
  3810.  
  3811.   Creates a text representation (resource description) of the resource
  3812.   fork of resourceFile, according to the resource type declarations
  3813.   in the resource description file(s). The resource description is
  3814.   written to standard output.
  3815.  
  3816.   A resource description file is a file of type declarations in the
  3817.   format used by the resource compiler, Rez. The type declarations
  3818.   for standard Macintosh resources are contained in the files Types.r
  3819.   and SysTypes.r, contained in the {RIncludes} folder. If no resource
  3820.   description file is specified, the output consists of data statements
  3821.   giving the resource data in hexadecimal form, without any additional
  3822.   format information.
  3823.  
  3824.   If the output of DeRez is used as input to Rez, with the same resource
  3825.   description files, it produces the same resource fork that was originally
  3826.   input to DeRez. DeRez is not guaranteed to be able to run a declaration
  3827.   backwards; if it can’t, it produces a data statement instead of the
  3828.   appropriate resource statement.
  3829.  
  3830.   DeRez ignores all include (but not #include), read, data, change,
  3831.   delete, and resource statements found in the resourceDescriptionFile.
  3832.   (It still parses these statements for correct syntax.)
  3833.  
  3834.   For the format of resource type declarations, see Chapter 11 and
  3835.   Appendix D of the MPW manual.
  3836.  
  3837.  
  3838.                              Examples
  3839.  
  3840.   DeRez "{ShellDirectory}MPW Shell" -only MENU Types.r
  3841.  
  3842.   Displays all of the 'MENU' resources used by the MPW Shell. The type
  3843.   definition for 'MENU' resources is found in the file Types.r.
  3844.  
  3845.   DeRez HD:OS:System SysTypes.r ∂
  3846.   -only "'DRVR' (∂"\\0x00Scrapbook∂")"
  3847.  
  3848.   Decompiles the Scrapbook desk accessory in the copy of the System
  3849.   file that’s located in directory HD:OS:. (The type definition for
  3850.   'DRVR' resources is found in the file SysTypes.r.)
  3851.  
  3852.  
  3853.                              See also 
  3854.  
  3855.   Rez and RezDet commands.
  3856.  
  3857.   Chapter 11.
  3858.  
  3859.   Type declaration files in RIncludes folder:
  3860.  
  3861.     • Types.r
  3862.  
  3863.     • SysTypes.r
  3864.  
  3865.     • MPWTypes.r
  3866.  
  3867.     • Pict.r
  3868.  
  3869. æKY Directory
  3870. æC           Directory -- set or write the default directory
  3871.  
  3872. Directory [-q | directory]   > directory
  3873.  -q                      # don't quote directories with special characters
  3874.  
  3875. Status codes returned:
  3876.   0    No error.
  3877.   1    Directory not found, command aborted, or parameter error.
  3878.  
  3879.                            Description
  3880.  
  3881.   If specified, directory becomes the new default directory. Otherwise
  3882.   the pathname of the current default directory is written to standard
  3883.   output.
  3884.  
  3885.   If directory is a leafname, the command searches for directory in
  3886.   the directories listed in the Shell variable {DirectoryPath}. If
  3887.   the variable is undefined, the command looks in the current directory.
  3888.  
  3889.     • Note: To display a directory’s contents, use the Files command.
  3890.  
  3891.  
  3892.                              Examples
  3893.  
  3894.   Directory
  3895.  
  3896.   Writes the pathname of the current directory to standard output.
  3897.  
  3898.   Directory HD:MPW:Examples:
  3899.  
  3900.   Sets the default directory to the folder Examples in the folder MPW
  3901.   on the volume HD. The final colon is optional.
  3902.  
  3903.   Directory Reports:
  3904.  
  3905.   Sets the default directory to the volume Reports. Note that volume
  3906.   names must end in a colon.
  3907.  
  3908.   Directory :Include:Pascal:
  3909.  
  3910.   Sets the default directory to the folder Pascal in the folder Include
  3911.   in the current default directory.
  3912.  
  3913.   Set DirectoryPath ":, {MPW}, {MPW}Projects:"
  3914.  
  3915.   Directory Tools
  3916.  
  3917.   Sets the directory to the Tools directory. The current directory
  3918.   is searched first, followed by the {MPW} directory, and finally by
  3919.   the {MPW} Projects directory. If there is no Tools directory in your
  3920.   current directory, the directory is set to {MPW}Tools.
  3921.  
  3922.  
  3923.                              See also 
  3924.  
  3925.   "File and Window Names" in Chapter 4.
  3926.  
  3927.   Files, NewFolder, and SetDirectory commands.
  3928.  
  3929. æKY DirectoryMenu
  3930. æC        DirectoryMenu [directory…] -- create the Directory menu
  3931.  
  3932. Status code returned:
  3933.    0    no errors always returned.
  3934.  
  3935.                            Description
  3936.  
  3937.   Creates the Directory menu shown here. The optional directory… parameter
  3938.   specifies the initial list of directories that appears in the menu.
  3939.   The menu items are described in Chapter 3 of the MPW manual.
  3940.  
  3941.   The lower section of the Directory menu contains a list of directories.
  3942.   Initially this list consists of the parameters to DirectoryMenu.
  3943.   As other directories become the current directory (using the Set
  3944.   Directory menu item or the SetDirectory command), they are added
  3945.   to the list.
  3946.  
  3947.  
  3948.                              Examples
  3949.  
  3950.   DirectoryMenu `(Files -d -i {MPW}Examples:≈) ≥ Dev:Null` `Directory`
  3951.  
  3952.   Creates the Directory menu. Directories in directory {MPW} that match
  3953.   the pattern Examples:≈ will be included in the Directory menu, along
  3954.   with the current directory.
  3955.  
  3956.   This DirectoryMenu command should be included in your UserStartup
  3957.   file to install the Directory menu. You might replace the Examples
  3958.   directories and the default directory with your favorite list of
  3959.   directories.
  3960.  
  3961. æKY DoIt
  3962. æC       DoIt -- highlight and execute a series of shell commands
  3963.  
  3964. DoIt (CommandFile [-echo] [-dump]) | [-selection]
  3965.  -echo                   # echo commands before execution
  3966.  -dump                   # dump unexecuted commands after error
  3967.  -selection              # execute command in the current selection
  3968.  
  3969. Status codes returned:
  3970.   0    No errors.
  3971.   1    Syntax error.
  3972.  
  3973.                            Description
  3974.  
  3975.   DoIt will execute a series of Shell commands, highlighting each command
  3976.   as it is executed. The commands can be either in a file or in the
  3977.   current selection of the active window. If a CommandFile is passed
  3978.   to DoIt, the file is opened (as the active window) and each command
  3979.   is executed. The window is closed when all commands have been processed.
  3980.  
  3981.   This command will not work for a series of commands that contains
  3982.   structured commands such as If statements or Loops.
  3983.  
  3984.  
  3985.                              Examples
  3986.  
  3987.   Backup -from "HD:Src:" -to "Backup:Src" -a -r -c > out
  3988.  
  3989.   DoIt out
  3990.  
  3991.   The above command will highlight and execute all the Duplicate commands
  3992.   generated by the Backup command. In this way you can see progress
  3993.   as the files are being duplicated.
  3994.  
  3995.   AddMenu DoIt "DoIt Selection" "DoIt -selection"
  3996.  
  3997.   The above AddMenu command will create a menu that can be used to
  3998.   highlight and execute the current selection. This could be used on
  3999.   a series of commands generated by Make or Backup that were written
  4000.   to the Active window. Simply select the commands and select the "DoIt
  4001.   Selection" menu item.
  4002.  
  4003.   Make > make.out
  4004.  
  4005.   DoIt -dump make.out
  4006.  
  4007.   This DoIt command will open the make.out file and highlight and execute
  4008.   each of the commands generated by the previous make command. In this
  4009.   way you can see progress as the files are being compiled and linked.
  4010.   If an error occurs (for instance, in one of the compiles), that compile
  4011.   command along with the rest of the commands in the make.out will
  4012.   be written to the WorkSheet. At this point you could fix the error
  4013.   (in the source file), select the "ToDo" marker (which would select
  4014.   the remaining commands), and select the "DoIt Selection" menu item
  4015.   to execute the remaining commands.
  4016.  
  4017. æKY DumpCode
  4018. æC              DumpCode -- write formatted CODE resources
  4019.  
  4020. DumpCode [option…] resourceFile  > dump ≥ progress
  4021.     -a                      # Show offsets from beginning of segment
  4022.     -d                      # don't dump object code
  4023.     -di                     # don't dump data initialization info
  4024.     -h                      # don't write headers (offsets, hex, etc.)
  4025.     -jt                     # don't dump jump table
  4026.     -n                      # dump only resource names
  4027.     -p                      # write progress information to diagnostics
  4028.     -r byte1[,byte2]        # dump code from address byte1 (through byte2)
  4029.     -ri                     # don't dump a5- and segment-relocation info
  4030.     -rt type[=id]           # dump only resources with this type (and id)
  4031.     -s name                 # dump only resource with this name
  4032.  
  4033. Status codes returned:
  4034.   0    No problem.
  4035.   1    Syntax error.
  4036.   2    Fatal error.
  4037.  
  4038.                            Description
  4039.  
  4040.   Disassembles object code that is stored in resources such as 'CODE',
  4041.   'DRVR', and 'PDEF'. DumpCode reads from the resource fork of the
  4042.   specified file and writes the formatted assembly code to standard
  4043.   output. The default formatting convention is to disassemble the code
  4044.   and to display the corresponding bytes in hexadecimal and ASCII.
  4045.  
  4046.   The default behavior of DumpCode is to dump all the 'CODE' resources
  4047.   from a program file. The -rt option can be used to dump resources
  4048.   of other types, such as drivers and desk accessories.
  4049.  
  4050.   Some conventions about executable code resources are built into DumpCode
  4051.   and affect the formatted output in special ways:
  4052.  
  4053.     • 'CODE' resources with ID 0 are formatted as a jump table (unloaded
  4054.     format).
  4055.  
  4056.     • Other 'CODE' resources have information about jump table entries
  4057.     in the first four bytes.
  4058.  
  4059.     • 'DRVR' resources have a special format at the beginning of
  4060.     the resource.
  4061.  
  4062.   In addition, you can direct DumpCode to give a symbolic dump of data
  4063.   initialization descriptors and initial values.
  4064.  
  4065.  
  4066.                              Examples
  4067.  
  4068.   DumpCode Sample > SampleDump
  4069.  
  4070.   Formats the 'CODE' resources in the file Sample, writing the output
  4071.   to the file SampleDump. The output has this format:
  4072.  
  4073.   File: sample, Resource 3, Type: CODE, Name: _DataInit
  4074.   Offset of first jump table entry: $00000018
  4075.   Segment is $000000D2 bytes long, and uses 1 jump table entry
  4076.   000000: 48E7 FFF0 'H...' MOVEM.L D0-D7/A0-A3,-(A7)
  4077.   000004: 4247 'BG' CLR.W D7
  4078.   000006: 4EAD 0032 'N..2' JSR $0032(A5)
  4079.   00000A: 2218 '".' MOVE.L (A0)+,D1
  4080.   etc.
  4081.  
  4082.  
  4083.                              See also 
  4084.  
  4085.   DumpObj command.
  4086.  
  4087.   "The Jump Table" in the chapter "Segment Loader" of Inside Macintosh,
  4088.   for a description of the jump table.
  4089.  
  4090.   Appendix H, "Object File Format."
  4091.  
  4092. æKY DumpFile
  4093. æC               DumpFile -- display contents of any file
  4094.  
  4095. DumpFile  [ option… ]  filename > dump ≥ progress
  4096.  -rf                # display the resource fork of the file. (Default is 
  4097.                     # data fork.)
  4098.  -bf                # display both forks of the file
  4099.  -a                 # suppress display of ASCII character values. 
  4100.  -h                 # suppress display of hexadecimal characters.
  4101.  -o                 # suppress display of file offsets.
  4102.  -w nn              # width - display nn bytes on each line of output.
  4103.  -g nn              # group nn bytes together without intervening spaces.
  4104.  -p                 # write progress information to diagnostic output.
  4105.  -r byte1[,byteN]   # display only the byte range from byte1 to byteN.
  4106.  
  4107. Status codes returned:
  4108.   0    No problem.
  4109.   1    Syntax error.
  4110.   2    Fatal error.
  4111.  
  4112.                            Description
  4113.  
  4114.   DumpFile lets you display the contents of the resource fork or data
  4115.   fork of a file in a variety of formats.
  4116.  
  4117.  
  4118.                              Examples
  4119.  
  4120.   DumpFile -p ATestFile
  4121.  
  4122.   Formats the data fork of the file ATestFile and writes its contents
  4123.   to standard output. This output has the following format:
  4124.  
  4125.   DumpFile -p ATestFile
  4126.  
  4127.   MPW File Display Utility Version 3.0B1 Release April 15,
  4128.   1988 Start: 1:24:09 PM 4/19/88
  4129.  
  4130.   Copyright Apple Computer, Inc. 1985-1988
  4131.   All Rights Reserved.
  4132.  
  4133.   File : ATestFile
  4134.   Data Fork Length : 20
  4135.   Resource Fork Length : 382
  4136.   Dumping Data Fork from offset 0 to 20
  4137.  
  4138.     0: 54 68 69 73 20 69 73 20 61 20 74 65 73 74 20 66 This.is.a.test.file.
  4139.    10: 69 6C 65 2E
  4140.   DumpFile completed normally
  4141.   Execution required 0 seconds.
  4142.  
  4143.   DumpFile -w 12 -g 4 ATestFile
  4144.  
  4145.   Formats the data fork of the file ATestFile and writes its contents
  4146.   to standard output, grouping four bytes at a time and displaying
  4147.   12 bytes per line. This output has the following format:
  4148.  
  4149.   File : ATestFile
  4150.   Data Fork Length : 20
  4151.   Resource Fork Length : 382
  4152.   Dumping Data Fork from offset 0 to 20
  4153.  
  4154.     0: 54686973 20697320 61207465 This.is.a.te
  4155.     C: 73742066 696C652E st.file.
  4156.  
  4157.   DumpFile -rf -r 0,30 -g 4 ATestFile
  4158.  
  4159.   Formats the resource fork of the file ATestFile and writes the contents
  4160.   of bytes 0 through 30 to standard output in 4-byte groups. This output
  4161.   has the following format:
  4162.  
  4163.   File : ATestFile
  4164.   Data Fork Length : 20
  4165.   Resource Fork Length : 382
  4166.   Dumping Resource Fork from offset 0 to 30
  4167.  
  4168.     0: 00000100 0000014C 0000004C 00000032 .......L...L...2
  4169.    10: 696C652E 6F727920 2227227B 646972 ile.ory."'"{dir
  4170.  
  4171. æKY DumpObj
  4172. æC                DumpObj -- write formatted object file
  4173.  
  4174. DumpObj [option…] objectFile  > dump ≥ progress
  4175.     -d                      # don't dump object code
  4176.     -h                      # don't write headers (offsets, hex, etc.)
  4177.     -i                      # use ids, rather than names, in dump
  4178.     -jn                     # just use names, rather than ids, in dump
  4179.     -l                      # dump file locations of object records
  4180.     -m name                 # dump only module "name" or module containing
  4181.                             # entry-point "name" (-m option may be used repeatedly)
  4182.     -n                      # dump only the dictionary of names
  4183.     -p                      # write progress information to diagnostics
  4184.     -r byte1[,byte2]        # dump code from byte1 in file (through byte2)
  4185.     -mh                     # omit module summary header
  4186.     -mods                   # dump a module summary with entry point information
  4187.     -sym [Off]              # disable symbolic output 
  4188.          [On | Full]        # enable symbolic output (default), can be followed by:
  4189.             [,NoLabels]     #   omit label information
  4190.             [,NoLines]      #   omit source line information
  4191.             [,NoTypes]      #   omit type information
  4192.             [,NoVars]       #   omit variable information
  4193.  
  4194. Status codes returned:
  4195.   0    No problem.
  4196.   1    Syntax error.
  4197.   2    Fatal error.
  4198.  
  4199.                            Description
  4200.  
  4201.   Disassembles object code that is stored in the data fork of an object
  4202.   file. By convention, object files end in the suffix ".o". In addition,
  4203.   the object file must have type 'OBJ'.
  4204.  
  4205.  
  4206.                              Examples
  4207.  
  4208.   DumpObj Sample.p.o >SampleDump
  4209.  
  4210.   Formats the file Sample.p.o and writes its contents to the file SampleDump.
  4211.   This output has the following format:
  4212.  
  4213.   Dump of file sample.p.o
  4214.   First: Kind 0 Version 1
  4215.   Dictionary: FirstId 2
  4216.     2: Main
  4217.  
  4218.   Pad
  4219.   Module: Flags $00 ModuleId 1 SegmentId Main
  4220.   Content: Flags $00
  4221.   Contents offset 0000 size 006A
  4222.  
  4223.   000000: 4E56 FFFE 'NV..' LINK A6,#$FFFE
  4224.   000004: 2F07 '/.' MOVE.L D7,-(A7)
  4225.   000006: 42A7 'B.' CLR.L -(A7)
  4226.   000008: 3F3C 0080 '?<..' MOVE.W #$0080,-(A7)
  4227.   etc.
  4228.  
  4229.   For more information, see Appendix H.
  4230.  
  4231.  
  4232.                              See also 
  4233.  
  4234.   DumpCode command.
  4235.  
  4236.   Appendix H, "Object File Format."
  4237.  
  4238.  
  4239. æKY Duplicate
  4240. æC             Duplicate -- duplicate files and directories
  4241.  
  4242. Duplicate [-y | -n | -c] [-p] [-d | -r] name… target  ≥ progress
  4243.  -y                      # overwrite target files (avoids dialog)
  4244.  -n                      # don't overwrite target files (avoids dialog)
  4245.  -c                      # cancel if conflict occurs (avoids dialog)
  4246.  -p                      # write progress information to diagnostics
  4247.  -d                      # duplicate data fork only
  4248.  -r                      # duplicate resource fork only
  4249.  
  4250. Status codes returned:
  4251.   0    All objects were duplicated.
  4252.   1    Syntax error.
  4253.   2    An error occurred.
  4254.   4    Cancel was selected or implied from the -c option.
  4255.  
  4256.                            Description
  4257.  
  4258.   Duplicates name to targetName. (Name and targetName are file or directory
  4259.   names.) If targetName is a file or doesn’t exist, the file or directory
  4260.   name is duplicated and named targetName. If targetName is a directory,
  4261.   the objects named are duplicated into that directory. (If more than
  4262.   one name is present, targetName must be a directory.) Created objects
  4263.   are given the same creation and modification dates as their source.
  4264.  
  4265.   If a directory is duplicated, its contents (including all subdirectories)
  4266.   are also duplicated. No directory duplicated can be a parent of targetName.
  4267.  
  4268.   Name can also be a volume; if targetName is a directory, name is
  4269.   copied into targetName.
  4270.  
  4271.   A dialog box requests a confirmation if the duplication would overwrite
  4272.   an existing file or folder. You can use the -y, -n, or -c option
  4273.   in scripts to avoid this interaction.
  4274.  
  4275.  
  4276.                              Examples
  4277.  
  4278.   Duplicate Aug86 "Monthly Reports"
  4279.  
  4280.   Assuming "Monthly Reports" is an existing directory, duplicates the
  4281.   file Aug86 into that directory.
  4282.  
  4283.   Duplicate File1 Folder1 "Backup Disk:"
  4284.  
  4285.   Duplicates File1 and Folder1 (including its contents) onto Backup
  4286.   Disk.
  4287.  
  4288.   Duplicate -y File1 File2
  4289.  
  4290.   Duplicates File1 to File2, overwriting File2 if it exists.
  4291.  
  4292.   Duplicate Disk1:≈ HD:Files:
  4293.  
  4294.   Duplicates all of the files on Disk1 into the directory HD:Files.
  4295.  
  4296.   Duplicate Disk1: HD:Files:
  4297.  
  4298.   Duplicates all of Disk1 (as a directory) into HD:Files.
  4299.  
  4300.   Limitation Duplicate doesn’t recognize folders on non-HFS disks.
  4301.  
  4302.  
  4303.                              See also 
  4304.  
  4305.   Move and Rename commands.
  4306.  
  4307.   "File and Window Names" in Chapter 4.
  4308.  
  4309.   "Filename Generation" in Chapter 5.
  4310.  
  4311. æKY Echo
  4312. æC                      Echo -- echo parameters
  4313.  
  4314. Echo [-n] [parameter…]   > parameters
  4315.  -n                      # don't write return following the parameters
  4316.  
  4317. Status codes returned:
  4318.   0    is always returned.
  4319.  
  4320.                            Description
  4321.  
  4322.   Writes its parameters, separated by spaces and terminated by a return,
  4323.   to standard output. If no parameters are specified, only a return
  4324.   is written.
  4325.  
  4326.   Echo is especially useful for checking the results of variable substitution,
  4327.   command substitution, and filename generation.
  4328.  
  4329.  
  4330.                              Examples
  4331.  
  4332.   Echo "Use Echo to write progress info from scripts."
  4333.  
  4334.   Use Echo to write progress info from scripts.
  4335.  
  4336.   The Echo command above writes the second line to standard output.
  4337.  
  4338.   Echo {Status}
  4339.  
  4340.   Writes the current value of the {Status} variable—that is, the status
  4341.   of the last command executed.
  4342.  
  4343.   Echo ≈.a
  4344.  
  4345.   Echoes the names of all files in the current directory that end with
  4346.   ".a". (This might be useful as a precaution before executing another
  4347.   command with the argument "≈.a".)
  4348.  
  4349.   Echo -n > EmptyFile
  4350.  
  4351.   If EmptyFile exists, this command deletes its contents; if the file
  4352.   doesn’t exist, it is created.
  4353.  
  4354.  
  4355.                              See also 
  4356.  
  4357.   Parameters and Quote commands.
  4358.  
  4359. æKY Eject
  4360. æC                       Eject -- eject volumes
  4361.  
  4362. Eject [-m] volume…
  4363.  -m                      # leave the volume mounted
  4364.  
  4365. Status codes returned:
  4366.   0    The disk was successfully ejected.
  4367.   1    Syntax error.
  4368.   2    An error occurred.
  4369.  
  4370.                            Description
  4371.  
  4372.   Flushes the volume, unmounts it, and then ejects it, if it is a 3.5-inch
  4373.   disk. A volume name must end with a colon ( : ). If volume is a number
  4374.   without a colon, it’s interpreted as a drive number.
  4375.  
  4376.     • Note: If you unmount the current volume (the volume containing
  4377.     the current directory), the boot volume becomes the current volume.
  4378.     You can keep the volume mounted with the -m option. (See the
  4379.     chapter "File Manager" of Inside Macintosh.)
  4380.  
  4381.  
  4382.                              Examples
  4383.  
  4384.   Eject Memos:
  4385.  
  4386.   Ejects (and unmounts) the disk titled Memos.
  4387.  
  4388.   Eject 1
  4389.  
  4390.   Ejects and unmounts the disk in drive 1 (the internal drive).
  4391.  
  4392.  
  4393.                              See also 
  4394.  
  4395.   Mount, Unmount, and Volumes commands.
  4396.  
  4397. æKY Entab
  4398. æC                Entab -- convert runs of spaces to tabs
  4399.  
  4400. Entab [option…] [file…]  < file > tabbed ≥ progress
  4401.  -a minValue             # Min run of blanks that can be replaced with a tab
  4402.  -d tabValue             # input tab setting
  4403.  -l quote…               # left quotes that prevent EnTab (default '")
  4404.  -n                      # no quote characters, EnTab everything
  4405.  -p                      # write progress information to diagnostics
  4406.  -q quote…               # quotes that prevent EnTab (default '")
  4407.  -r quote…               # right quotes that prevent EnTab (default '")
  4408.  -t tabValue             # output tab setting
  4409.  
  4410. Status codes returned:
  4411.   0    Normal termination.
  4412.   1    Parameter or option error.
  4413.  
  4414.                            Description
  4415.  
  4416.   Copies the specified text files to standard output, replacing runs
  4417.   of spaces with tabs. The default behavior of Entab is to do the following:
  4418.  
  4419.   1. Detab the input file, using the file’s tab setting (a resource
  4420.   saved with the file by the Shell editor), or 4 if there is none.
  4421.   You can override this "detab" value with the -d option.
  4422.  
  4423.   2. Entab the file, setting tab stops every 4 spaces. You can specify
  4424.   another tab setting with the -t option. The entabbed output file
  4425.   looks the same as the original file(s), but contains fewer characters.
  4426.  
  4427.   Options are also provided for controlling the processing of blanks
  4428.   between quoted strings.
  4429.  
  4430.  
  4431.                              Examples
  4432.  
  4433.   Entab -t 2 Example.p > CleanExample.p
  4434.  
  4435.   Detabs the file Example.p (using the file’s default tab setting),
  4436.   re-entabs it with a tab setting of 2, and writes the resulting output
  4437.   to CleanExample.p.
  4438.  
  4439.   Warning Beware of command formats such as
  4440.  
  4441.   Entab Foo > Foo
  4442.  
  4443.   Limitations Entab does not take into account embedded formatting
  4444.   characters other than tab characters. Thus backspace characters may
  4445.   cause incorrect results.
  4446.  
  4447.   The maximum width for an input line is 255 characters.
  4448.  
  4449.  
  4450.                              See also 
  4451.  
  4452.   Format command.
  4453.  
  4454. æKY Equal
  4455. æC                Equal -- compare files and directories
  4456.  
  4457. Equal [-d | -r] [-i] [-p] [-q] name… target  > differences ≥ progress
  4458.    -d                      # compare data forks only
  4459.    -r                      # compare resource forks only
  4460.    -i                      # ignore files in target not in directory name
  4461.    -p                      # write progress information to diagnostics
  4462.    -q                      # quiet - don't write output, just set {Status}
  4463.  
  4464. Status codes returned:
  4465.   0    Identical files.
  4466.   1    Syntax error.
  4467.   2    Inaccessible or missing parameter.
  4468.   3    Files not equal.
  4469.  
  4470.                            Description
  4471.  
  4472.   Compares name to targetName. By default, Equal makes no comment if
  4473.   files are the same; if they differ, it announces the byte at which
  4474.   the difference occurred. When comparing directories, the default
  4475.   condition is to report all differences, including files not found—the
  4476.   -i option ignores files in targetName that are not present in name.
  4477.  
  4478.   If targetName is a file, every name must also be a file. The specified
  4479.   files are compared with targetName.
  4480.  
  4481.   If targetName is a directory and name is a file, Equal checks in
  4482.   targetName for the file name and compares the two files. That is,
  4483.   the command
  4484.  
  4485.   Equal File1 Dir1
  4486.  
  4487.   compares File1 with :Dir1:File1.
  4488.  
  4489.   If more than one name is specified, Equal compares each name with
  4490.   the corresponding file or directory in targetName. All subdirectories
  4491.   are also compared. For example,
  4492.  
  4493.   Equal File1 Dir1 Dir2
  4494.  
  4495.   If targetName is a directory, name is a directory, and only one name
  4496.   is specified, the Equal command directly compares the two directories.
  4497.   That is, the command
  4498.  
  4499.   Equal Dir1 Dir2
  4500.  
  4501.   compares Dir1 (and all subdirectories) with Dir2.
  4502.  
  4503.  
  4504.                              Examples
  4505.  
  4506.   Equal File1 File1Backup
  4507.  
  4508.   Reports if the files are different and at what point they differ,
  4509.   in a message
  4510.  
  4511.   such as
  4512.  
  4513.   File1 File1Backup differ in data fork, at byte 5
  4514.  
  4515.   Equal -i HD:Dir1 Disk1:Dir1
  4516.  
  4517.   Compares all files and directories in HD:Dir1 with files and directories
  4518.   with the same names found in Disk1:Dir1, and reports any differences.
  4519.   This command does not report files in Disk1:Dir1 that aren’t found
  4520.   in HD:Dir1.
  4521.  
  4522.   Equal -i -d Backup: HD:Source
  4523.  
  4524.   Compares the data forks of all files on the volume Backup: with all
  4525.   those of the same name in the directory HD:Source.
  4526.  
  4527.   Equal -p Old:≈.c HD:Source
  4528.  
  4529.   Compares all files on Old: ending in ".c" with their counterparts
  4530.   in HD:Source. Prints progress information as the comparison proceeds.
  4531.  
  4532.  
  4533.                              See also 
  4534.  
  4535.   Compare command.
  4536.  
  4537. æKY Erase
  4538. æC                     Erase -- initialize volumes
  4539.  
  4540. Erase [-y] [-s] volume…
  4541.  -y                      # yes - erase the disk (avoids dialog)
  4542.  -s                      # single-sided - 400K (default 800K)
  4543.  
  4544. Status codes returned:
  4545.   0    Successful initialization.
  4546.   1    Syntax error.
  4547.   2    No such volume, or boot volume.
  4548.   3    Errors during the initialization procedure.
  4549.  
  4550.                            Description
  4551.  
  4552.   Initializes the specified volumes— the previous contents are destroyed.
  4553.   A volume name must end with a colon ( : ). If volume is a number
  4554.   without a colon, it’s interpreted as a disk drive number.
  4555.  
  4556.   A dialog box requests confirmation before proceeding with the command,
  4557.   unless the -y option is specified. The -y option can be used in scripts
  4558.   to avoid this interaction.
  4559.  
  4560.  
  4561.                              Examples
  4562.  
  4563.   Erase Reports:
  4564.  
  4565.   Initializes the volume entitled Reports.
  4566.  
  4567.   Erase 1
  4568.  
  4569.   Initializes the volume in drive 1 (the internal drive). The disk
  4570.   will be formatted as a 400K disk if drive 1 is a 400K drive, or as
  4571.   an 800K disk if drive 1 is an 800K drive.
  4572.  
  4573. æKY Evaluate
  4574. æC                  Evaluate -- evaluate an expression
  4575.  
  4576. Evaluate [-h | -o | -b] [word…]  > value
  4577. Evaluate Name [binary operator]= expression
  4578.   -h                      # display result in hexadecimal (leading 0x)
  4579.   -o                      # display result in octal (leading 0)
  4580.   -b                      # display result in binary (leading 0b)
  4581.  
  4582. Status codes returned:
  4583.   0    Valid expression.
  4584.   1    Invalid expression.
  4585.  
  4586.                            Description
  4587.  
  4588.   The list of words is taken as an expression. After evaluation, the
  4589.   result is written to standard output. Missing or null parameters
  4590.   are taken as zero. You should quote string operands that contain
  4591.   blanks or any of the characters listed in the table that follows.
  4592.  
  4593.   The operators and precedence are mostly those of the C language;
  4594.   descriptions follow.
  4595.  
  4596.   The second form of the Evaluate command evaluates the list of words
  4597.   and assigns the result to the variable name. The result of the expression
  4598.   is not written to standard output in this case. C style operations
  4599.   of the form "+=", "-=", and so on, are supported. If name is undefined
  4600.   at the time of execution, it is interpreted as zero.
  4601.  
  4602.   Different radices can be used in the input expression, and the result
  4603.   can be output in a different radix by using the -h, -o, or -b option.
  4604.   The default radix is decimal.
  4605.  
  4606.   Expressions: An expression can include any of the following operators.
  4607.   (In some cases, two or three different symbols can be used for the
  4608.   same operation.) The operators are listed in order of precedence;
  4609.   within each group, operators have the same precedence.
  4610.  
  4611.   Operator           Operation
  4612.  
  4613.   1. (expr)          Parentheses are used to group expressions
  4614.  
  4615.   2.  -              Unary negation
  4616.  
  4617.       ~              Bitwise negation
  4618.  
  4619.       !              NOT ¬ Logical NOT
  4620.  
  4621.   3.  *              Multiplication
  4622.  
  4623.       ÷              DIV Division
  4624.  
  4625.      %               MOD Modulus division
  4626.  
  4627.   4. +               Addition
  4628.  
  4629.      -               Subtraction
  4630.  
  4631.   5. <<              Shift left
  4632.  
  4633.      >>              Shift right
  4634.  
  4635.   6. <               Less than
  4636.  
  4637.      <= ≤            Less than or equal to
  4638.  
  4639.      >               Greater than
  4640.  
  4641.      >= ≥            Greater than or equal to
  4642.  
  4643.   7. ==              Equal
  4644.  
  4645.      != <> ≠         Not equal
  4646.  
  4647.      =~              Equal—regular expression
  4648.  
  4649.      !~              Not equal—regular expression
  4650.  
  4651.   8. &               Bitwise AND
  4652.  
  4653.   9. ^               Bitwise XOR
  4654.  
  4655.   10. |              Bitwise OR
  4656.  
  4657.   11. && AND         Logical AND
  4658.  
  4659.   12. || OR          Logical OR
  4660.  
  4661.   All operators group from left to right. Parentheses can be used to
  4662.   override the operator precedence. Null or missing operands are interpreted
  4663.   as zero. The result of an expression is always a string representing
  4664.   a number in the specified radix (the default is decimal).
  4665.  
  4666.   The logical operators !, NOT, ¬, &&, AND, | |, and OR interpret null
  4667.   and zero operands as false, and nonzero operands as true. Relational
  4668.   operators return the value 1 when the relation is true, and the value
  4669.   0 when the relation is false.
  4670.  
  4671.   The string operators ==, !=, =~, and !~ compare their operands as
  4672.   strings. All others operate on numbers. Numbers may be decimal, hexadecimal,
  4673.   octal, or binary integers representable by a 32-bit signed value.
  4674.   Hexadecimal numbers begin with either $ or 0x. Octal numbers begin
  4675.   with a 0 (zero). Binary numbers begin with 0b. Every expression is
  4676.   computed as a 32-bit signed value. Overflows are ignored.
  4677.  
  4678.   Input Radices
  4679.  
  4680.   Decimal number [0–9]
  4681.  
  4682.   Hexadecimal number 0x[0–9A–F]
  4683.  
  4684.   Octal number 0[0–7]
  4685.  
  4686.   Binary number 0b[01]
  4687.  
  4688.   The pattern-matching operators =~ and !~ are like == and != except
  4689.   that the right side is a regular expression that is matched against
  4690.   the left operand. Regular expressions must be enclosed within the
  4691.   regular expression delimiters /…/. Regular expressions are summarized
  4692.   in Appendix B.
  4693.  
  4694.     • Note: There is one difference between using regular expressions
  4695.     after =~ and !~ and using them in editing commands. When evaluating
  4696.     an expression that contains the tagging operator, ®, the Shell
  4697.     creates variables of the form {®n}, containing the matched substrings
  4698.     for each ® operator. (See the examples that follow.)
  4699.  
  4700.   Filename generation, conditional execution, pipe specifications,
  4701.   and input/output specifications are disabled within expressions,
  4702.   to allow the use of many special characters that would otherwise
  4703.   have to be quoted.
  4704.  
  4705.   Expressions are also used in the If, Else, Break, Continue, and Exit
  4706.   commands.
  4707.  
  4708.  
  4709.                              Examples
  4710.  
  4711.   Evaluate (1+2) * (3+4)
  4712.  
  4713.   Does the computation and writes the result to standard output.
  4714.  
  4715.   Evaluate -h 8 + 8
  4716.  
  4717.   Does the computation and writes the result to standard output in
  4718.   hexadecimal (0x10).
  4719.  
  4720.   Evaluate 0xA + 6
  4721.  
  4722.   Writes the result 16 to standard output. (The default output radix
  4723.   is decimal. Use -h for hexadecimal.)
  4724.  
  4725.   Evaluate lines += 1
  4726.  
  4727.   The Evaluate command increments the value of the Shell variable {lines}
  4728.   by 1. If {lines} was undefined before executing the command, {lines}
  4729.   would be 1 after execution.
  4730.  
  4731.   ( Evaluate "{aPathname}" =~ /(([¬:]+:)*)®1≈/ ) > Dev:Null
  4732.  
  4733.   Echo {®1}
  4734.  
  4735.   These commands examine a pathname contained in the variable {aPathname}
  4736.   and return the directory prefix portion of the name. In this case,
  4737.   Evaluate is used for its side effect of enabling regular expression
  4738.   processing of a filename pattern. The right side of the expression
  4739.   ( /(([¬:]+:)*)®1≈/ ) is a regular expression that matches everything
  4740.   in a pathname up to the last colon and remembers it as the Shell
  4741.   variable {®1}. Evaluate’s actual output is not of interest, so it’s
  4742.   redirected to the bit bucket, Dev:Null. (See "Pseudo-Filenames" in
  4743.   Chapter 5.) Note that the use of I/O redirection means that the Evaluate
  4744.   command must be enclosed in parentheses so that the output redirection
  4745.   symbol, >, is not taken as an expression operator.
  4746.  
  4747.   This is a complex but useful example of implementing a "substring"
  4748.   function. For a similar example, see the Rename command.
  4749.  
  4750.  
  4751.                              See also 
  4752.  
  4753.   "Structured Commands" in Chapter 5.
  4754.  
  4755.   "Pattern Matching (Using Regular Expressions)" in Chapter 6, and
  4756.   Appendix B.
  4757.  
  4758. æKY Execute
  4759. æC         Execute -- execute command file in the current scope
  4760.  
  4761. Execute commandFile
  4762.  
  4763. Execute returns the status returned by script.
  4764.  
  4765.                            Description
  4766.  
  4767.   Executes the script as if its contents appeared in place of the Execute
  4768.   command. This means that variable definitions, exports, and aliases
  4769.   in the script will continue to exist after it has finished executing.
  4770.   (Normally these definitions, exports, and aliases would be local
  4771.   to the script.) Any parameters following script are ignored. Any
  4772.   parameters to the enclosing script are available within script.
  4773.  
  4774.     • Note: If script is not a command file (that is, if it’s a built-in
  4775.     command, tool, or application), the command is run as if the
  4776.     word Execute did not appear. Parameters are passed to the command
  4777.     as usual.
  4778.  
  4779.  
  4780.                              Examples
  4781.  
  4782.   Execute {ShellDirectory}Startup
  4783.  
  4784.   Executes the Startup (and UserStartup) scripts. This command is useful
  4785.   for testing any changes you’ve made to the Startup-UserStartup script.
  4786.   Variable definitions, exports, and aliases set in Startup and UserStartup
  4787.   will be available after Startup is done executing.
  4788.  
  4789.  
  4790.                              See also 
  4791.  
  4792.   "Defining and Redefining Variables" in Chapter 5.
  4793.  
  4794.   "The Startup and UserStartup Files" in Chapter 5.
  4795.  
  4796. æKY Exists
  4797. æC        Exists -- confirm the existence of a file or directory
  4798.  
  4799. Exists [-d | -f | -w] [-q] name…  > file
  4800.   -d                      # check if name is a directory
  4801.   -f                      # check if name is a file
  4802.   -w                      # check if name is a file and writeable
  4803.   -q                      # don't quote file names with special characters
  4804.  
  4805. Status codes returned:
  4806.   0    No error.
  4807.   1    Syntax error.
  4808.   2    Other error.
  4809.  
  4810.                            Description
  4811.  
  4812.   Determines the existence of the file or directory name. The options
  4813.   help you to distinguish between directories and files and different
  4814.   access permissions. The nonexistence of name is not considered an
  4815.   error (status remains zero).
  4816.  
  4817.  
  4818.                              Examples
  4819.  
  4820.   If Not "`Exists -d HD:dir`"
  4821.     NewFolder HD:dir
  4822.   End
  4823.   Duplicate ≈.c HD:dir
  4824.  
  4825.   This example creates a new directory and copies all files ending
  4826.   with ".c" in the current directory to this new directory.
  4827.  
  4828.  
  4829.                              See also 
  4830.  
  4831.   Newer command.
  4832.  
  4833. æKY Exit
  4834. æC                   Exit -- exit from a command file
  4835.  
  4836. Exit [status] [If expression]
  4837.  
  4838. If status is present, it is returned as the status value of the 
  4839. script. If the expression is invalid, –5 is returned. Otherwise, the status 
  4840. of the last command executed is returned. 
  4841.  
  4842.                            Description
  4843.  
  4844.   If the expression is nonzero (that is, true), Exit terminates execution
  4845.   of the script in which it appears. When used interactively, Exit
  4846.   terminates execution of previously entered commands. Status is a
  4847.   number; if present, it is returned as the status value of the script.
  4848.   Otherwise, the status of the previous command is returned. If the
  4849.   "If expression" is omitted, the Exit is unconditional. (For a definition
  4850.   of expression, refer to the description of the Evaluate command.)
  4851.  
  4852.  
  4853.                              Examples
  4854.  
  4855.   Exit {ExitStatus}
  4856.  
  4857.   As the last line of a script, this Exit command would return as a
  4858.   status value whatever value had previously been assigned to {ExitStatus}.
  4859.  
  4860.  
  4861.                              See also 
  4862.  
  4863.   Evaluate command (for information on expressions).
  4864.  
  4865.   "Structured Commands" in Chapter 5.
  4866.  
  4867.   {Exit} and {Status} variables, in "Variables," Chapter 5.
  4868.  
  4869. æKY Export
  4870. æC            Export -- make variables available to commands
  4871.  
  4872. Export [-r | -s | name…]  > exports
  4873.  -r                      # generate Unexport commands for all exported variables
  4874.  -s                      # print the names only
  4875.  
  4876. Status codes returned:
  4877.   0    No errors.
  4878.   1    Syntax error.
  4879.  
  4880.                            Description
  4881.  
  4882.   Make the specified variables available to scripts and tools. The
  4883.   list of variables exported within a script is local to that script.
  4884.   An enclosed script or tool inherits a list of exported variables
  4885.   from the enclosing script . (See Figure 5-1 in Chapter 5 of the MPW manual
  4886.   for clarification.)
  4887.  
  4888.     • Note: You can make a variable available to all scripts and
  4889.     tools by setting and exporting it in the Startup or UserStartup
  4890.     files. (Startup acts as the enclosing script for all Shell operations.)
  4891.  
  4892.   If no names are specified, a list of exported variables is written
  4893.   to standard output. (Note that the default output of Export is in
  4894.   the form of Export commands.)
  4895.  
  4896.  
  4897.                              Examples
  4898.  
  4899.   Set AIncludes {MPW}Interfaces:AIncludes:
  4900.  
  4901.   Export AIncludes
  4902.  
  4903.   Defines the variable {AIncludes} as the pathname {MPW}Interfaces:AIncludes:
  4904.   and makes it available to scripts and programs.
  4905.  
  4906.  
  4907.                              See also 
  4908.  
  4909.   Unexport, Set, and Execute commands.
  4910.  
  4911.   "The Startup and UserStartup Files" in Chapter 5.
  4912.  
  4913.   "Exporting Variables" in Chapter 5.
  4914.  
  4915. æKY FileDiv
  4916. æC          FileDiv -- divide a file into several smaller files
  4917.  
  4918. FileDiv [option…] file [prefix]  ≥ progress
  4919.  -b              # input is a byte stream instead of lines
  4920.  -f              # split file at formfeed character
  4921.  -n splitPoint   # split file after splitPoint lines or bytes (-b)
  4922.  -p              # write progress information to diagnostics
  4923.  -s n            # set -b input buffer to n * 512 bytes
  4924.  
  4925. Status codes returned:
  4926.   0    Normal termination.
  4927.   1    Parameter or option error.
  4928.  
  4929.                            Description
  4930.  
  4931.   FileDiv is the inverse of the Catenate command. It is used to break
  4932.   a large file into several smaller pieces. The input file is divided
  4933.   into smaller files, each containing an equal number of lines determined
  4934.   by the splitpoint (default=2000). The last file contains whatever
  4935.   is left over.
  4936.  
  4937.   There is also an option (-f) for splitting a file only when a form
  4938.   feed character
  4939.  
  4940.   (ASCII $0C) occurs as the first character of a line that is beyond
  4941.   the splitpoint. This option lets you split a file at points that
  4942.   are known to be the tops of pages.
  4943.  
  4944.   Each group of splitpoint lines is written to a file with the name
  4945.   prefixNN, where NN is a number starting at 01. If the prefix is omitted,
  4946.   the input file name is used as the prefix.
  4947.  
  4948.  
  4949.                              Examples
  4950.  
  4951.   FileDiv -f -n 2500 Bigfile
  4952.  
  4953.   Splits Bigfile into files of at least 2500 lines; splits the file
  4954.   at points where there are form feed characters. The output files
  4955.   have the names BigfileNN, where NN is 01, 02, and so on.
  4956.  
  4957.   Limitation The maximum length of an input line is 255 characters.
  4958.  
  4959. æKY Files
  4960. æC                  Files -- list files and directories
  4961.  
  4962. Files [option…] [name…]  > fileList
  4963.  -c creator              # list only files with this creator
  4964.  -d                      # list only directories
  4965.  -f                      # list full pathnames
  4966.  -i                      # treat all arguments as files
  4967.  -l                      # long format (type, creator, size, dates, etc.)
  4968.  -m columns              # n column format, where n = columns
  4969.  -n                      # don't print header in long or extended format
  4970.  -o                      # omit directory headers
  4971.  -q                      # don't quote filenames with special characters
  4972.  -r                      # recursively list subdirectories
  4973.  -s                      # suppress the listing of directories
  4974.  -t type                 # list only files of this type
  4975.  -x format               # extended format with the fields specified by format
  4976.  
  4977.  Note: The following characters can specify the format
  4978.      a   Flag attributes
  4979.      b   Logical size, in bytes, of the data fork
  4980.      r   Logical size, in bytes, of the resource fork
  4981.      c   Creator of File ("Fldr" for folders)
  4982.      d   Creation date
  4983.      k   Physical size in kilobytes of both forks
  4984.      m   Modification date
  4985.      t   Type
  4986.      o   Owner (only for folders on a file server)
  4987.      g   Group (only for folders on a file server)
  4988.      p   Privileges (only for folders on a file server)
  4989.  
  4990. Status codes returned:
  4991.   0    All names were processed successfully.
  4992.   1    Syntax error.
  4993.   2    An error occurred.
  4994.  
  4995.                            Description
  4996.  
  4997.   For each disk or directory named, Files lists its contents; for each
  4998.   file named, Files writes its name and any other information requested.
  4999.   Information is written to standard output. When a directory is listed,
  5000.   all subdirectories are listed first in alphabetical order, followed
  5001.   by all files in alphabetical order. If no name is given, the current
  5002.   directory is listed.
  5003.  
  5004.  
  5005.                              Examples
  5006.  
  5007.   files -r -s -f
  5008.  
  5009.   HD:source:defs.h
  5010.   HD:source:main.c
  5011.   HD:source:backup:main.c
  5012.   HD:source:backup:defs.h
  5013.   HD:source:junk:tmpfile
  5014.  
  5015.   Recursively lists the contents of the current directory, giving full
  5016.   pathnames and suppressing the printing of directory names.
  5017.  
  5018.   files -d
  5019.  
  5020.   :backup:
  5021.   :junk:
  5022.  
  5023.   Lists only the directories in the current directory.
  5024.  
  5025.   Files -i -x kd {AIncludes}
  5026.  
  5027.   Name                         Size    Creation-Date
  5028.   --------------------------- ------ ----------------
  5029.   HD:MPW:Interfaces:AIncludes: 365K   8/25/87 5:32 AM
  5030.  
  5031.   Lists the size and creation date of the {AIncludes} directory. Notice
  5032.   how the -i option is used to avoid printing the contents of the directory.
  5033.  
  5034.   files -m 2
  5035.  
  5036.   :backup: deFs.h
  5037.   :junk: main.c
  5038.  
  5039.   This is the two-column format. Notice the order of the files.
  5040.  
  5041. æKY Find
  5042. æC                Find -- find and select a text pattern
  5043.  
  5044. Find [-c count] selection [window]
  5045.  -c count                # find the nth selection, where n = count
  5046.  
  5047. Status codes returned:
  5048.   0    At least one instance of the selection was found.
  5049.   1    Syntax error.
  5050.   2    Any other error.
  5051.  
  5052.                            Description
  5053.  
  5054.   Creates a selection in window. If no window is specified, the target
  5055.   window (the second window from the front) is assumed. It’s an error
  5056.   to specify a window that doesn’t exist.
  5057.  
  5058.   Selection is a selection as defined in Chapter 6 and in Appendix B of the
  5059.   MPW manual.
  5060.  
  5061.     • Note: Searches do not necessarily start at the beginning of
  5062.     a window. A forward search begins at the end of the current selection
  5063.     and continues to the end of the document. A backward search begins
  5064.     at the start of the current selection and continues to the beginning
  5065.     of the document.
  5066.  
  5067.   All searches are not case sensitive by default. You can specify case-sensitive
  5068.   searches by first setting the Shell variable {CaseSensitive} to a
  5069.   nonzero value. (Or, you can automatically set {CaseSensitive} by
  5070.   checking Case Sensitive in the dialog boxes displayed by the Find
  5071.   and Replace menu items.)
  5072.  
  5073.  
  5074.                              Examples
  5075.  
  5076.   Find •
  5077.  
  5078.   Positions the insertion point at the beginning of the target window.
  5079.  
  5080.   Find -c 5 /procedure/ Sample.p
  5081.  
  5082.   Selects the fifth occurrence of "procedure" in the window Sample.p.
  5083.  
  5084.   Find 332
  5085.  
  5086.   Selects line 332 in the target window.
  5087.  
  5088.  
  5089.                              See also 
  5090.  
  5091.   "Selections" and "Pattern Matching" in Chapter 6, and Appendix B.
  5092.  
  5093.   "Find Menu" in Chapter 3.
  5094.  
  5095. æKY Flush
  5096. æC          Flush -- flush the tools that the Shell has cached
  5097.  
  5098. Flush
  5099. \.
  5100. Status codes returned:
  5101.   0    No errors always returned.
  5102.  
  5103.                            Description
  5104.  
  5105.   Flush clears the MPW Shell's tool cache.
  5106.  
  5107.   The MPW Shell keeps the most recently used tools in memory so that
  5108.   execution can be faster. However, there are times when you don’t
  5109.   want the tools to be in the cache. For example, you cannot run a
  5110.   tool, and then switch to the Finder and delete the file. The Finder
  5111.   will report that the tool is busy. You might also want to flush the
  5112.   cache is when you are running benchmarks or timing tool performance.
  5113.  
  5114.  
  5115.                              Examples
  5116.  
  5117.   Flush
  5118.  
  5119.   Flush the current cache. This will free all tools in the cache.
  5120.  
  5121. æKY For
  5122. æC                  For -- repeat commands once per parameter
  5123.  
  5124. For name In word…
  5125.  command…
  5126. End
  5127.  
  5128. Status codes returned:
  5129.   0    The list of words or list of commands was empty.
  5130.   –3   There was an error in the parameters to For.
  5131.  
  5132.                            Description
  5133.  
  5134.   Executes the list of commands once for each word from the "In word…"
  5135.   list. The current word is assigned to variable name, and you can
  5136.   therefore reference it in the list of commands by using the notation
  5137.   {name}. You must end each line with either a return character (as
  5138.   shown above) or with a semicolon (;).
  5139.  
  5140.   The Break command can be used to terminate the loop. The Continue
  5141.   command can be used to terminate the current iteration of the loop.
  5142.  
  5143.   The pipe specification (|), conditional command terminators (&& and
  5144.   ||), and input/output specifications (<, >, >>, ≥, ≥≥, ∑, and ∑∑)
  5145.   may appear following the End; they apply to all of the commands in
  5146.   the list.
  5147.  
  5148.  
  5149.                              Examples
  5150.  
  5151.   For i In 1 2 3
  5152.     Echo i = {i}
  5153.   End
  5154.  
  5155.   Returns the following:
  5156.  
  5157.   i = 1
  5158.   i = 2
  5159.   i = 3
  5160.  
  5161.   For File In ≈.c
  5162.     C {File} ; Echo {File} compiled.
  5163.   End
  5164.  
  5165.   This example compiles every file in the current directory whose name
  5166.   ends with the suffix ".c". The Shell first expands the filename pattern
  5167.   ≈.c, creating a list of the filenames after the "In" word. The enclosed
  5168.   commands are then executed once for each name in the list. Each time
  5169.   the loop is executed, the variable {File} represents the current
  5170.   word in the list. {File} is quoted because a filename could contain
  5171.   spaces or other special characters.
  5172.  
  5173.   For file in Startup UserStartup Suspend Resume Quit
  5174.     Entab {file} > temp
  5175.     Rename -y temp {file}
  5176.     Print -h {file}
  5177.     Echo {file}
  5178.   End
  5179.  
  5180.   This example entabs (replaces multiple spaces with tabs) the five
  5181.   files listed, prints them with headings, and echoes the name of each
  5182.   file after printing is complete. You might want to use this set of
  5183.   commands before making copies of the files to give to a friend. Entabbing
  5184.   the files saves considerable disk space, and printing them gives
  5185.   you some quick documentation to go with the files.
  5186.  
  5187.  
  5188.                              See also 
  5189.  
  5190.   Loop, Break, and Continue commands.
  5191.  
  5192.   "Structured Commands" in Chapter 5.
  5193.  
  5194. æKY Format
  5195. æC        Format -- set or display formatting options for a window
  5196.  
  5197. Format [[-f font] [-s fontsize] [-t tabsize] [-a attr]] | [-x fmt] [window…]
  5198.  -f fontName             # set font to fontName
  5199.  -s fontSize             # set the font size to fontSize
  5200.  -t tabSize              # set the tab size to tabSize
  5201.  -a attr                 # set the auto indent and show invisibles flags
  5202.  -x fmt                  # output the current format in the specified format
  5203.  
  5204.  Note: The following attributes may be used with the -a option:
  5205.      A   auto indentation on
  5206.      a   auto indentation off
  5207.      I   show invisibles on
  5208.      i   show invisibles off
  5209.      L   lock auto scrolling
  5210.      l   unlock auto scrolling
  5211.  
  5212.  Note: The following characters may be used with the -x option:
  5213.      f   font name
  5214.      s   font size
  5215.      t   tab size
  5216.      a   attributes
  5217.  
  5218. Status codes returned:
  5219.   0    No errors.
  5220.   1    Syntax error (error in parameters).
  5221.   2    All other errors.
  5222.  
  5223.                            Description
  5224.  
  5225.   This is a scriptable form of the Format menu command in the Edit
  5226.   menu. Use it to set the format of a specified list of windows. If
  5227.   no window is specified, the command operates on the target window.
  5228.   If no options are specified (other than -x), the current format settings
  5229.   are written to standard output.
  5230.  
  5231.     • Note: The Format command (and the Format menu command) modify
  5232.     the format of an existing window. The format related variables
  5233.     such as {Tab} and {Font} are used to initialize the format of
  5234.     a new window.
  5235.  
  5236.  
  5237.                              Examples
  5238.  
  5239.   Format -f Monaco -t 8 -a A {target}
  5240.  
  5241.   Sets the font, tab size, and auto-indent in the target window. The
  5242.   font size and invisible settings are not changed.
  5243.  
  5244.   Format -s 12 MyWindow
  5245.  
  5246.   Changes the font size in MyWindow to 12 point.
  5247.  
  5248.   Format {Target}
  5249.  
  5250.   A format statement with no options displays the current format of
  5251.   the window, such as the following:
  5252.  
  5253.   Format -f Monaco -s 9 -t 8 -a Ai
  5254.  
  5255.   You can then select and execute this output format.
  5256.  
  5257.   Format -x tsf
  5258.  
  5259.   4 9 Monaco
  5260.  
  5261.   Displays only the values of the specified options. Use this option
  5262.   for easily retrieving one or two values and assigning them to Shell
  5263.   variables for later use.
  5264.  
  5265.  
  5266.                              See also 
  5267.  
  5268.   The "Edit Menu," in Chapter 3.
  5269.  
  5270.   "Variables" in Chapter 5.
  5271.  
  5272. æKY Get
  5273. æC             Get -- get a record from an indexed file
  5274.  
  5275. Get (dataFile… | -dfl listfFle) [-k key] [-width w] [-d default key] [-h | -h2] 
  5276.     [-l] [-m] [-nf] [-q] [-s]  [-x] [-search] [-t] [-sfl] [-y] [-field field list] 
  5277.     [-format format string] ] [-lessFields field list]
  5278.  
  5279.  
  5280.     dataFile                # A specially formatted help file which must be 
  5281.                             # accompanied by an index file whose name is of 
  5282.                             # the form: dataFile.index, and and whose type is 'btre'
  5283.     -dfl listFile           # listFile contains a list of datafiles
  5284.     -k keyword              # keyword in the datafile's index file
  5285.     -width w                # column format for key lists, w = 1..200 is the 
  5286.                             # window width in characters
  5287.     -d default              # use default keyword if no keyword is specified
  5288.     -h                      # write full header
  5289.     -h2                     # write short header (only the used datafile)
  5290.     -l                      # list all keys in the first data file that begin
  5291.                             # with nnn, where nnn is the keyword following -k
  5292.     -lessFields tag [,tag]… # remove the named items from the existing field list 
  5293.                             # (default list or as specified by -field)
  5294.     -m                      # Select the keyword that was found and assign a marker to the selection
  5295.     -nf                     # no filtering; include field tags
  5296.     -q                      # quiet output when keyword not found
  5297.     -s                      # use the selection in the active window as keyword
  5298.     -x                      # create or update the cross reference index file
  5299.     -search                 # text search datafile for occurrences of keyword
  5300.     -t                      # write out template of the requested function/procedure
  5301.     -field tag[,tag]…       # specify the data field(s) to display
  5302.     -format format_string   # specify string(s) to be output in front of data
  5303.                             # specified in -field option.  '%s' flags in string 
  5304.                             # correspond ordinally to tags in -field option
  5305.     -sfl                    # produce ordered list of data files 
  5306.                             # (requires -dfl listFile)
  5307.     -y                      # do not present dialog before (re)building index file
  5308.  
  5309. Status codes returned:  
  5310.   0    The search was successful
  5311.   1    There was a syntax error
  5312.   2    There was an error in processing
  5313.   3    There was a system or out of memory error
  5314.   4    The key was not found.
  5315.  -9    The user aborted the program
  5316.    
  5317.                            Description
  5318.  
  5319.   Get searches the btree file dataFile.index looking for the key word
  5320.   key. If found, Get will return data associated with the key word from 
  5321.   the file dataFile.  The data may be formatted by columns.
  5322.  
  5323. æKY GetErrorText
  5324. æC     GetErrorText -- display error messages based on message number
  5325.  
  5326. GetErrorText [-f filename] [-s filename] [-n] [-p] errnbr[,insert,…] …
  5327. GetErrorText -i idnbr,…
  5328.  # display error messages based on message number
  5329.  
  5330.  -f filename             # explicit error msg file
  5331.  -i idnbr                # report meaning of System Error Handler ID number
  5332.  -n                      # suppress error numbers in displayed messages
  5333.  -p                      # write SysErrs's version info to diagnostics
  5334.  -s filename             # explicit system error msg file (default SysErrs.Err)
  5335.  
  5336. Status codes returned:
  5337.   0    Normal termination.
  5338.   1    Parameter or option error.
  5339.  
  5340.                            Description
  5341.  
  5342.   Displays the error messages corresponding to a set of specified error
  5343.   numbers or ID numbers. By default, GetErrorText assumes that the
  5344.   error numbers correspond to Macintosh Operating System error numbers.
  5345.   The file SysErrs.Err is a special file used by MPW tools to determine
  5346.   the error messages corresponding to system error numbers. Other system
  5347.   error message files may be specified by using the -s option.
  5348.  
  5349.   In addition to system errors, some tools have their own error message
  5350.   files. For example, the assembler's error message file is in the
  5351.   data resource fork of Asm itself. For such tools, you can display
  5352.   the error messages corresponding to tool error numbers by specifying
  5353.   the -f option. In this case, you can specify sample inserts, along
  5354.   with the error numbers, for error messages that take inserts, as
  5355.   shown above.
  5356.  
  5357.   GetErrorText can also display the meanings of the ID numbers reported
  5358.   by the System Error Handler in alert dialog boxes. The -i option
  5359.   is used for this purpose.
  5360.  
  5361.  
  5362.                              Examples
  5363.  
  5364.   GetErrorText -43 -44 -45
  5365.  
  5366.   Displays the error messages corresponding to system errors -43, -44,
  5367.   and -45.
  5368.  
  5369.   GetErrorText -i 28 2
  5370.  
  5371.   Displays the error messages corresponding to system ID numbers 28
  5372.   and 2.
  5373.  
  5374. æKY GetFileName
  5375. æC          GetFileName -- display a Standard File dialog box
  5376.  
  5377. GetFileName [-q] [-s] 
  5378.             [-c | [[-t TYPE]… | -p | -d | -wd] [-m message] [-b buttontitle] [pathname]]
  5379.     -b buttontitle          # specify the default button's title
  5380.     -c                      # write current standard file path to standard output
  5381.     -d                      # select a directory
  5382.     -wd                     # select a directory on a non-locked volume
  5383.     -m message              # specify a prompt
  5384.     -p                      # select a new filename (SFPutFile) 
  5385.     -q                      # suppress quoting of filenames
  5386.     -s                      # return 0 status even if cancel is clicked
  5387.     -t type                 # specify file type for SFGetFile dialog
  5388.  
  5389. Status codes returned:
  5390.   0    User specified a file and no errors occurred.
  5391.   1    Parameter or option error.
  5392.   2    System error.
  5393.   4    User canceled the standard file dialog box.
  5394.  
  5395.                            Description
  5396.  
  5397.   GetFileName displays a standard file dialog box. Either SFPutFile
  5398.   or SFGetFile is called, and the returned filename or pathname is
  5399.   written to standard output. The standard file starting directory
  5400.   is set to pathname if specified. If pathname includes a local filename
  5401.   and if SFPutFile is called, the local filename is used as the default
  5402.   filename. See the examples.
  5403.  
  5404.  
  5405.                              Examples
  5406.  
  5407.   Open `GetFileName -t TEXT {pinterfaces}`
  5408.  
  5409.   Opens the text file in directory {pinterfaces} chosen in SFGetFile
  5410.   by the user.
  5411.  
  5412.   GetFileName -p HD:MPW:StartUp
  5413.  
  5414.   An SFPutFile dialog box is displayed with the directory set to HD:MPW:
  5415.   and StartUp is displayed in the textedit field of the dialog box.
  5416.  
  5417.   Limitation The resulting filename cannot be longer than 255 characters.
  5418.  
  5419.  
  5420.                              See also 
  5421.  
  5422.   "The Standard File Package," Inside Macintosh, Volume I.
  5423.  
  5424. æKY GetListItem
  5425. æC      GetListItem -- display items for selection in a dialog box
  5426.  
  5427. GetListItem [option…] [[item…] | < file]
  5428.     -c[ancel]               # return a status of 0 even when cancel is clicked
  5429.     -d[efault] item         # item is entered in list and comes up selected
  5430.     -m[essage] message      # display message in dialog above the list
  5431.     -q[uote]                # don't quote items in the output
  5432.     -r[ows] rows            # make the list with this many rows
  5433.     -s[ingle]               # only allow a single selection
  5434.     -sort                   # display list items in alphabetic order
  5435.     -w[idth] width          # make the list this many pixels wide
  5436.  
  5437. Status codes returned:
  5438.   0    No errors (or Cancel button was clicked if  -c option is used).
  5439.   1    Syntax error (bad option).
  5440.   2    Cancel button was clicked.
  5441.  
  5442.                            Description
  5443.  
  5444.   Takes the items on the command line (or, if no items are present
  5445.   on the command line, items from standard input) and lists them in
  5446.   a dialog box. Items in the list can be selected with the mouse and
  5447.   modifier keys. Selected items are written to standard output when
  5448.   the OK button is clicked.
  5449.  
  5450.  
  5451.                              Examples
  5452.  
  5453.   Print `files -t TEXT | GetListItem -m "Select files to print:"`
  5454.  
  5455.   Lists all text files in the current directory and prints those selected
  5456.   by the user, as shown below.
  5457.  
  5458. æKY Help.MPW
  5459. æC                  Help -- write summary information
  5460.  
  5461. Help [-f helpfile] [command…]  > helpInformation
  5462.  -f helpfile             # alternate helpfile (default MPW.Help)
  5463.  
  5464. Status codes returned:
  5465.   0    Information was found for the given command.
  5466.   1    Syntax error.
  5467.   2    A command could not be found.
  5468.   3    The help file could not be opened.
  5469.  
  5470. æKY If
  5471. æC                 If -- conditional command execution
  5472.  
  5473. If expression
  5474.  command…
  5475. [Else If expression
  5476.  command… ] …
  5477. [Else
  5478.  command… ]
  5479. End
  5480.  
  5481. Status codes returned:
  5482.    0    None of the lists of commands were executed.
  5483.   –1    Invalid expression.
  5484.  
  5485.                            Description
  5486.  
  5487.   Executes the list of commands following the first expression whose
  5488.   value is nonzero. (Null strings are considered zero.) At most one
  5489.   list of commands is executed. You may specify any number of "Else
  5490.   If" clauses. The final Else clause is optional. The return characters
  5491.   (as shown above) or semicolons must appear at the end of each line.
  5492.  
  5493.   The pipe specification (|), conditional command terminators (&& and
  5494.   ||), and input/output specifications (<, >, >>, ≥, ≥≥, ∑, ∑∑) may
  5495.   appear following the End and apply to all of the commands in the
  5496.   list.
  5497.  
  5498.   For a definition of expression, see the description of the Evaluate
  5499.   command.
  5500.  
  5501.  
  5502.                              Examples
  5503.  
  5504.   If {Status} == 0
  5505.     Beep 1a,25,200
  5506.   Else
  5507.     Beep -3a,25,200
  5508.   End
  5509.  
  5510.   Produces an audible indication of the success or failure of the preceding
  5511.   command.
  5512.  
  5513.   For window in `Windows`
  5514.     If {window} != {Worksheet} AND {window} != {Active}
  5515.       Close {window}
  5516.     End
  5517.   End
  5518.  
  5519.   Closes all of the open windows except the active window and the Worksheet
  5520.   window. (Refer also to the Windows command.)
  5521.  
  5522.   The following commands, as a script, would implement a trivial case
  5523.   of a general "compile" command:
  5524.  
  5525.   If {1} =~ /≈.c/
  5526.     C {COptions} {1}
  5527.   Else If {1} =~ /≈.p/
  5528.     Pascal {POptions} {1}
  5529.   End
  5530.  
  5531.   If the above commands were saved in a file (say, as "Compile"), both
  5532.   C and Pascal programs could be compiled with the command
  5533.  
  5534.   Compile filename
  5535.  
  5536.  
  5537.                              See also 
  5538.  
  5539.   Evaluate command (for a description of expressions).
  5540.  
  5541.   "Structured Commands" in Chapter 5.
  5542.  
  5543. æKY Lib
  5544. æC           Lib -- combine object files into a library file
  5545.  
  5546. Lib [option…] objectFile…  ≥ progress
  5547.     -d                      # suppress duplicate definition warnings
  5548.     -df deleteFile          # delete modules listed in file deleteFile
  5549.     -dm name[,name]…        # delete external modules and entry points
  5550.     -dn name[,name]…        # delete external names, making them local
  5551.     -f                      # allow FORTRAN-style common data
  5552.     -mf                     # use MultiFinder temporary memory if necessary
  5553.     -o name                 # write object file name (default Lib.Out.o)
  5554.     -p                      # write progress information to diagnostics
  5555.     -rn OldNameA=NewNameA   # change module name(s) OldNameA to NewNameA,
  5556.       [,OldNameB=NewNameB]… #   OldNameB to NewNameB, etc.
  5557.     -sg newSeg=old[,old]…   # merge old segments into new segment
  5558.     -sn oldSeg=newSeg       # change segment name oldSeg to newSeg
  5559.     -sym [On | Full]        # keep symbolic information (default)
  5560.          [Off]              # discard symbolic information, can be followed by:
  5561.             [,NoLabels]     # discard label information
  5562.             [,NoLines]      # discard source line information
  5563.             [,NoTypes]      # discard type information
  5564.             [,NoVars]       # discard variable information
  5565.     -ver N                  # set OMF file version number to N
  5566.     -w                      # suppress warnings
  5567.  
  5568. Status codes returned:
  5569.   0    No problem.
  5570.   1    Syntax error.
  5571.   2    Fatal error.
  5572.  
  5573.                            Description
  5574.  
  5575.   Combines the specified object files into a single file. Input files
  5576.   must have type 'OBJ' .
  5577.  
  5578.   Lib is used for the following:
  5579.  
  5580.     • Combining object code from different languages into a single
  5581.     file.
  5582.  
  5583.     • Combining several object files into a larger object file (a
  5584.     library).
  5585.  
  5586.     • Combining several libraries into a single library, for use
  5587.     in building a particular application or desk accessory. This
  5588.     can greatly improve the performance of the Linker.
  5589.  
  5590.     • Deleting unneeded modules (with the -dm option), changing segmentation
  5591.     (the -sg and -sn options), or changing the scope of a symbol
  5592.     from external to local (the -dn option). (These options are useful
  5593.     when you construct a specialized library for linking a particular
  5594.     program.)
  5595.  
  5596.   Object files that have been processed with Lib result in significantly
  5597.   faster links when compared with the "raw" object files produced by
  5598.   the assembler or compilers.
  5599.  
  5600.   The output of Lib is logically equivalent to the concatenation of
  5601.   the input files, except for the optional renaming, resegmentation,
  5602.   and deletion operations, and the possibility of overriding an external
  5603.   name. The resolution of external names in Lib is identical to Link—in
  5604.   fact, the two programs share the same code for reading object files.
  5605.   Although multiple symbols are reduced to a single symbol, no combining
  5606.   of modules into larger modules is performed, and no cross-module
  5607.   references are resolved. This behavior guarantees that the Linker’s
  5608.   output will be the same size whether or not the output of Lib was
  5609.   used.
  5610.  
  5611.   See "Library Construction" in Chapter 10 of the MPW manual for a detailed 
  5612.   discussion of the behavior and use of Lib.
  5613.  
  5614.  
  5615.                              Examples
  5616.  
  5617.   Lib {CLibraries}≈ -o {CLibraries}CLibrary.o
  5618.  
  5619.   Combines all of the library object files from the {CLibraries} directory
  5620.   into a single library named CLibrary.o. For applications that require
  5621.   most or all of the C library files, using the new CLibrary file will
  5622.   reduce link time.
  5623.  
  5624.  
  5625.                              See also 
  5626.  
  5627.   Link, DumpObj, and DumpCode commands.
  5628.  
  5629.   "Optimizing Your Links" and "Library Construction" in Chapter 10.
  5630.  
  5631.   Appendix H.
  5632.  
  5633. æKY Line
  5634. æC                Line -- find line in the target window
  5635.  
  5636. Line n
  5637.  
  5638. Status codes can be returned by either the Find or the Open commands 
  5639. that make up the Line script:
  5640.   0    No errors.
  5641.   1    Syntax error.
  5642.   2    No target window; other error.
  5643.   3    System error.
  5644.  
  5645.                            Description
  5646.  
  5647.   Line finds line n in the target window. The parameter n is usually
  5648.   an integer, but may be any selection expression. The target window
  5649.   becomes the active (frontmost) window.
  5650.  
  5651.   Line is a script containing these two commands:
  5652.  
  5653.   Find {1} {target} # Find line n in the target window
  5654.  
  5655.   Open {target} # Bring the target window to the top
  5656.  
  5657.  
  5658.                              Examples
  5659.  
  5660.   Line 123
  5661.  
  5662.   Finds line 123 in the target window and makes the target window the
  5663.   new active window.
  5664.  
  5665.   ### Undefined symbol: length
  5666.  
  5667.   File Count.c; Line 75
  5668.  
  5669.   The File and Line commands above are part of an error message produced
  5670.   by the MPW C compiler. The MPW Assembler and MPW Pascal compilers
  5671.   produce errors when using similar formats. You can execute such error
  5672.   messages to find the line that contains the error.
  5673.  
  5674.   The command File is defined as an alias for Target in the Startup
  5675.   file. Thus File opens the specified file as the target window. Line
  5676.   then selects the offending line in the window and brings the window
  5677.   to the front. Notice that the remainder of the error message is a
  5678.   comment.
  5679.  
  5680.  
  5681.                              See also 
  5682.  
  5683.   Find command.
  5684.  
  5685. æKY Link
  5686. æC           Link -- link an application, tool, or resource
  5687.  
  5688. Link [option…] objectFile…  > map ≥ progress
  5689.  -ac alignment           # align code modules to 'n' byte boundaries
  5690.  -ad alignment           # align data modules to 'n' byte boundaries
  5691.  -c creator              # set resourceFile creator (default ????)
  5692.  -d                      # suppress duplicate definition warnings
  5693.  -da                     # desk accessory - add NULL to segment names
  5694.  -f                      # allow FORTRAN-style common data
  5695.  -l                      # write a location map to output
  5696.  -la                     # -l, include anonymous symbols in location map
  5697.  -lf                     # -l, include file and location of definitions
  5698.  -m mainEntry            # use mainEntry as main entry point
  5699.  -ma name=alias          # create an alias for module name
  5700.  -map                    # generate "friendly" link map
  5701.  -mf                     # use MultiFinder temporary memory if necessary
  5702.  -model far              # process 32-bit load-time relocatable references
  5703.  -model near             # prohibit 32-bit load-time relocatable references
  5704.  -msg keyword[,…]        # message options
  5705.      [no]dup             #   (suppress) warnings about duplicate symbols
  5706.      [no]multiple        #   (suppress) multiple undefined symbol reports
  5707.      [no]warn            #   (suppress) warning messages
  5708.  -o resourceFile         # write resourceFile (default Link.Out)
  5709.  -opt [Off]              # disable Object Pascal optimizations (default)
  5710.       [On ]              # enable optimizations
  5711.       [NoBypass]         # enable optimizations, but always dispatch
  5712.          [,Info]         #   write optimization information to diagnostics
  5713.          [,Names]        #   include MacsBug symbols within SelectorProc modules
  5714.  -p                      # write progress information to diagnostics
  5715.  -pg size                # set page size to "size"; max:32K; min: 1024; default: 2048
  5716.  -ra [seg]=attr[,attr…]  # set segment resource attributes:
  5717.      $xx (or) nnn        #   a hex or decimal attribute you figure out
  5718.      resSysHeap          #   or a comma-seperated list of resource
  5719.      resPurgeable        #    attributes by name
  5720.      resLocked           #   
  5721.      resProtected        #   
  5722.      resPreload          #   
  5723.      resChanged          #   (essentially ignored)
  5724.  -rn                     # don't include resource names in resourceFile
  5725.  -rt type[=id]           # set resource type and lowest id (default CODE=0)  
  5726.  -sg newSeg[=old[,old]…] # merge old segments into new segment
  5727.  -sn oldSeg=newSeg       # change segment name oldSeg to newSeg
  5728.  -srt                    # sort global data by "near" and "far" references
  5729.  -ss size                # maximum segment size (default 32760)
  5730.  -sym [Off]              # disable symbolic output (default)
  5731.          [On | Full]     # enable symbolic output, can be followed by:
  5732.          [,NoLabels]     #   omit label information
  5733.          [,NoLines]      #   omit source line information
  5734.          [,NoTypes]      #   omit type information
  5735.          [,NoVars]       #   omit variable information
  5736.  -t type                 # set resourceFile type (default APPL)
  5737.  -uf unrefFile           # write list of unreferenced modules to unrefFile
  5738.  -w                      # suppress warnings
  5739.  -wrap                   # when jump table space is exhausted, put excess jump table 
  5740.                          #   entries in global data space, if available
  5741.  -x crossRefFile         # write cross reference to crossRefFile
  5742.  
  5743. Status codes returned:
  5744.   0    No problem.
  5745.   1    Syntax error.
  5746.   2    Fatal error.
  5747.  
  5748.                            Description
  5749.  
  5750.   Links the specified object files into an application, tool, desk
  5751.   accessory, or driver. The input object files must have type 'OBJ'.
  5752.   Linked segments from the input object files are placed in code resources
  5753.   in the resource fork of the output file. The default output filename
  5754.   is Link.Out, but you can specify other names with the -o option.
  5755.  
  5756.   For detailed information about the linker, and instructions for linking
  5757.   applications, MPW tools, and desk accessories, see Chapters 8 and
  5758.   10 of the MPW manual. The first dialog box of Link’s Commando dialog is 
  5759.   reprinted here for convenience.
  5760.  
  5761.   The linker’s default action is to link an application, placing the
  5762.   output segments into 'CODE' resources. When you link an application,
  5763.   all old 'CODE' resources are deleted before the new 'CODE' resources
  5764.   are written. By default, resources created by the linker are given
  5765.   resource names that are the same as the corresponding segment names.
  5766.   You can change a resource (segment) name with the -sn or -sg options,
  5767.   and you can create unnamed resources with the -rn option.
  5768.  
  5769.   The linker executes in four phases:
  5770.  
  5771.     • Input phase: The linker reads all input files, finds all symbolic
  5772.     references and their corresponding definitions, and constructs
  5773.     a reference graph. Duplicate references are found and warnings
  5774.     are issued.
  5775.  
  5776.     • Analysis phase: The linker allocates and relocates code and
  5777.     data, detects missing references, and builds the jump table.
  5778.     If the -l or -x option is given, Link produces a linker map or
  5779.     cross-reference listing. The linker also eliminates unused code
  5780.     and data.
  5781.  
  5782.     • Output phase: The linker copies linked code segments into code
  5783.     resources in the resource fork of the output file. By default,
  5784.     these resources are given the same names as the corresponding
  5785.     segment names. (The cursor spins backward during this phase.)
  5786.  
  5787.     • Symbolic output phase: Optionally, Link may be used to create
  5788.     the .SYM file for use with SADE.
  5789.  
  5790.  
  5791.                              Examples
  5792.  
  5793.   Link Sample.p.o ∂
  5794.   "{PLibraries}"PInterface.o ∂
  5795.   "{PLibraries}"PasLib.o ∂
  5796.   "{Libraries}"Runtime.o ∂
  5797.   -o Sample ∂
  5798.   -la >Sample.map
  5799.  
  5800.   Links the main program file Sample.p.o with the libraries PInterface.o,
  5801.   PasLib.o, and Runtime.o, placing the output in Sample and placing
  5802.   the Linker map in the file Sample.map. Sample is an application that
  5803.   can be launched from the Finder or executed from MPW.
  5804.  
  5805.   Link -rt MROM=8 -c 'MPS ' -t ZROM -ss 140000 ∂
  5806.   -l > ROMLocListing -o MyROMImage {LinkList}
  5807.  
  5808.   Links the files defined in the Shell variable {LinkList} into a ROM
  5809.   image file, placing the output in the file MyROMImage. The segment
  5810.   size is set to 140,000 bytes, and the ROM is created as a resource
  5811.   'MROM' with ID=8. The file is typed as being created by MPW (creator
  5812.   'MPS '), with file type ZROM. Link’s location-ordered listing is
  5813.   placed in the file ROMLocListing.
  5814.  
  5815.   For additional examples, see "Link" in Chapter 10 and the makefiles
  5816.   in the Examples folders for the languages you are using.
  5817.  
  5818.  
  5819.                              See also 
  5820.  
  5821.   Lib command and Appendix H, "Object File Format."
  5822.  
  5823.   Chapter 8, "The Build Process," and Chapter 10, "Link."
  5824.  
  5825.   The Segment Loader and the Resource Manager chapters in Inside Macintosh.
  5826.  
  5827.   Inside Macintosh, Volume IV, for information on the 128K ROM, the
  5828.   System Folder, and the Finder.
  5829.  
  5830. æKY Loop
  5831. æC                 Loop -- repeat commands until Break
  5832.  
  5833. Loop
  5834.  command…
  5835. End
  5836.  
  5837. Loop returns the status of the last command executed.
  5838.  
  5839.                            Description
  5840.  
  5841.   Executes the enclosed commands repeatedly. The Break command is used
  5842.   to terminate the loop. The Continue command can be used to terminate
  5843.   the current iteration of the loop.
  5844.  
  5845.   The pipe specification (|), conditional command terminators (&& and
  5846.   ||), and input/output specifications (<, >, >>, ≥, ≥≥, ∑, and ∑∑)
  5847.   may appear following the End, and apply to all of the commands in
  5848.   the list.
  5849.  
  5850.  
  5851.                              Examples
  5852.  
  5853.   The following script runs a command several times, once for each
  5854.   parameter:
  5855.  
  5856.   ### Repeat - Repeat a command for several parameters ###
  5857.  
  5858.   # Syntax:
  5859.  
  5860.   # Repeat command parameter…
  5861.  
  5862.   #
  5863.  
  5864.   # Execute command once for each parameter in the parameter
  5865.  
  5866.   # list. Options can be specified by including them with
  5867.  
  5868.   # the command name in quotes.
  5869.  
  5870.   #
  5871.  
  5872.   Set cmd {1}
  5873.  
  5874.   Loop
  5875.  
  5876.   Shift
  5877.  
  5878.   Break If {1} ==
  5879.  
  5880.   {cmd} {1}
  5881.  
  5882.   End
  5883.  
  5884.   Notice that Shift is used to step through the parameters, and that
  5885.   Break ends the loop when all parameters have been used.
  5886.  
  5887.  
  5888.                              See also 
  5889.  
  5890.   Break, For, and Continue commands.
  5891.  
  5892.   "Structured Commands" in Chapter 5.
  5893.  
  5894. æKY Make
  5895. æC             Make -- build up-to-date version of a program
  5896.  
  5897. Make [option…] target…   > commands ≥ progress
  5898.  -d name[=value]         # define variable name as value (overrides makefile)
  5899.  -e                      # rebuild everything regardless of dates
  5900.  -f makefile             # read dependencies from makefile (default MakeFile)
  5901.  -p                      # write progress information to diagnostics
  5902.  -r                      # write roots of dependency graph to output
  5903.  -s                      # write structure of target dependencies to output
  5904.  -t                      # touch dates of targets and prerequisites
  5905.  -u                      # identify targets in makefile not reached in build
  5906.  -v                      # write verbose explanations to diagnostics
  5907.  -w                      # suppress warnings
  5908.  -y                      # like -v, but omit announcing up-to-date targets
  5909.  
  5910.  
  5911. Status codes returned:
  5912.   0    Successful completion.
  5913.   1    Parameter or option error.
  5914.   2    Execution error.
  5915.  
  5916.                            Description
  5917.  
  5918.   Generates a set of Shell commands that you can execute to build up-to-date
  5919.   versions of the specified target files. (If no target is specified,
  5920.   the target on the left side of the first dependency rule in the makefile
  5921.   is built.) Make allows you to rebuild only those components of a
  5922.   program that require rebuilding. Make determines which components
  5923.   need rebuilding by reading a makefile. This is a text file that describes
  5924.   dependencies between the components of a program, along with the
  5925.   Shell commands needed to rebuild each component. You can specify
  5926.   makefiles with the -f option. After processing the makefiles, Make
  5927.   writes to standard output the appropriate set(s) of commands needed
  5928.   to rebuild the target(s).
  5929.  
  5930.   See "Format of a Makefile" in Chapter 9 of the MPW manual for a 
  5931.   description of the format of a makefile. The first dialog box of Make’s 
  5932.   Commando dialog is reproduced here for convenience.
  5933.  
  5934.   Make executes in two phases:
  5935.  
  5936.     • In the first phase, Make reads the makefile(s) and creates
  5937.     a file (target) dependency graph. (The "beachball" cursor spins
  5938.     counterclockwise during this phase.)
  5939.  
  5940.     • In the second phase, Make generates the build commands for
  5941.     the target to be built (the cursor spins clockwise). If a target
  5942.     file doesn’t exist or if it depends on files that are out-of-date
  5943.     or newer than the target, Make writes out the appropriate command
  5944.     lines for updating the target file. This process is recursive
  5945.     and "bottom up" so that commands are issued first for those lower-level
  5946.     dependencies that need to be rebuilt.
  5947.  
  5948.   You can execute the generated build commands after Make is done executing.
  5949.  
  5950.  
  5951.                              Examples
  5952.  
  5953.   Make -p -f MakeFile Sample
  5954.  
  5955.   Makes the target file Sample, and prints progress information. Sample’s
  5956.   dependency relations are described in the makefile :AExamples:MakeFile.
  5957.  
  5958.   Sample ƒƒ Sample.r
  5959.       Rez Sample.r -o Sample -a
  5960.       SetFile -a B Sample -c ASMP -t APPL #set bundle bit
  5961.  
  5962.   Sample ƒƒ Sample.r Sample.a.o
  5963.       Link Sample.a.o -o Sample
  5964.  
  5965.   Sample.a.o ƒ Sample.a
  5966.       Asm Sample.a
  5967.  
  5968.   The ƒ (Option-F) character means "is a function of"—that is, the
  5969.   file on the left side depends on the files on the right side. If
  5970.   the files on the right are newer, the subsequent Shell commands are
  5971.   written to standard output. (See Chapter 9 for details.)
  5972.  
  5973.  
  5974.                              See also 
  5975.  
  5976.   "Format of a Makefile" in Chapter 9 for the format of a makefile,
  5977.   examples, and other information about using Make.
  5978.  
  5979.   Makefiles for building sample programs are contained in the Examples
  5980.   folders:
  5981.  
  5982.     • Examples:AExamples:Makefile
  5983.  
  5984.     • Examples:PExamples:Makefile
  5985.  
  5986.     • Examples:CExamples:Makefile
  5987.  
  5988.  
  5989. æKY MakeErrorFile
  5990. æC            MakeErrorFile -- create error message textfile
  5991.  
  5992. MakeErrorFile [option…] [file…]  < file > listing ≥ progress
  5993.  -l                      # write listing to standard output
  5994.  -o file/dir             # output file or directory
  5995.  -p                      # write progress information to diagnostics
  5996.  
  5997. Status codes returned:
  5998.   0    No errors.
  5999.   1    Syntax error.
  6000.   2    Error in processing.
  6001.  
  6002.                            Description
  6003.  
  6004.   MakeErrorFile creates specially formatted error message files used
  6005.   to retrieve the error messages associated with error numbers. The
  6006.   ErrMgr unit in the ToolLibs.o library is used by programs to access
  6007.   the error files created by MakeErrorFile. SysErrs.Err is one such
  6008.   error file; it is used by various MPW tools to get the textual messages
  6009.   associated with Macintosh system error codes. See the documentation
  6010.   on the ErrMgr unit for more information on how error files are accessed.
  6011.  
  6012.  
  6013.                              Examples
  6014.  
  6015.   MakeErrorFile SysErrs -l >SysErrsList
  6016.  
  6017.   Writes an ordered list of system error numbers and messages to the
  6018.   file SysErrsList.
  6019.  
  6020.  
  6021. æKY Mark
  6022. æC                Mark -- assign a marker to a selection
  6023.  
  6024. Mark [-y | -n] selection name [window]
  6025.  -y                      # replace existing marker (avoids dialog)
  6026.  -n                      # don't replace existing marker (avoids dialog)
  6027.  
  6028. Status codes returned:
  6029.   0    No errors.
  6030.   1    Syntax error.
  6031.   2    Error in processing.
  6032.   3    System error.
  6033.  
  6034.                            Description
  6035.  
  6036.   Mark assigns the marker name to the range of text specified by the
  6037.   selection in window. If no window is specified, the command operates
  6038.   on the target window (the second window from the front). The new
  6039.   marker name is included in the Mark menu when window is the current
  6040.   active window. A marker is associated with a logical, as opposed
  6041.   to absolute, range of text. The ranges of markers may overlap, but
  6042.   each marker must have a unique name. Marker names are case sensitive.
  6043.  
  6044.   A dialog box requests confirmation if the marker name conflicts with
  6045.   an existing marker name. The -y or -n option can be used in scripts
  6046.   to avoid this interaction.
  6047.  
  6048.   Deletion and insertion operations affect markers according to these
  6049.   rules:
  6050.  
  6051.     • Any editing outside the range of a marker will not affect the
  6052.     logical range of the marker, where "outside" means that the range
  6053.     of editing changes does not intersect the range of the marker.
  6054.  
  6055.     • Any editing inside the range of a marker will change the logical
  6056.     range of the marker by the amount of the editing change. For
  6057.     example, adding ten characters to the inside of a marker’s range
  6058.     will increase the range of the marker by ten characters. Another
  6059.     way to say this is that a marker has responsibility for all the
  6060.     characters added to (or deleted from) its range.
  6061.  
  6062.     • Any deletion that totally encloses a marker will delete the
  6063.     marker.
  6064.  
  6065.  
  6066.                              Examples
  6067.  
  6068.   Mark § 'Procedure 1'
  6069.  
  6070.   Assigns a marker with the name "Procedure 1" to the current selection
  6071.   in the target window.
  6072.  
  6073.   Limitation It is currently not possible to "Undo" the effects of
  6074.   any editing operations on markers.
  6075.  
  6076.  
  6077.                              See also 
  6078.  
  6079.   Unmark and Markers commands.
  6080.  
  6081.   "Mark Menu" in Chapter 3.
  6082.  
  6083.   "Markers" in Chapter 6.
  6084.  
  6085. æKY Markers
  6086. æC                        Markers -- list markers
  6087.  
  6088. Markers [-q] [window]
  6089.  -q                      # don't quote the marker names
  6090.  
  6091. Status codes returned:
  6092.   0    No errors.
  6093.   1    Syntax error.
  6094.   2    Error in processing.
  6095.   3    System error.
  6096.  
  6097.                            Description
  6098.  
  6099.   Markers prints the names of all markers associated with window. The
  6100.   names are written one per line, and they are ordered from the beginning
  6101.   to the end of the window.
  6102.  
  6103.  
  6104.                              Examples
  6105.  
  6106.   Markers {Target}
  6107.  
  6108.   Lists all markers associated with the target window.
  6109.  
  6110.  
  6111.                              See also 
  6112.  
  6113.   "Mark Menu" in Chapter 3.
  6114.  
  6115.   "Markers" in Chapter 6.
  6116.  
  6117. æKY MatchIt
  6118. æC   MatchIt -- semi-intelligent language sensitive bracket matcher
  6119.  
  6120. MatchIt [-a[sm] | -p[ascal] | -c] [-h] [-l] [-n] [-v] [window]
  6121.  -a[sm]                  # target language is Assembler
  6122.  -p[ascal]               # target language is Pascal
  6123.  -c                      # target language is C
  6124.  -h                      # highlight all characters enclosed by match
  6125.  -l                      # highlight entire lines containing match
  6126.  -n                      # generate error message if no match
  6127.  -v                      # display MatchIt's version number
  6128.  
  6129. Status codes returned:
  6130.   0    Normal termination.
  6131.   1    Parameter or option error.
  6132.   3    Matching delimiter not found (only if -n option specified).
  6133.  
  6134.                            Description
  6135.  
  6136.   Matches C, Pascal, and assembly-language delimiters with their mates
  6137.   in the specified window. The default window is the target window
  6138.   (second from front). The characters highlighted as the current selection1
  6139.   in the window are used as the left delimiter. MatchIt attempts to
  6140.   find the corresponding right mate for the selected delimiter.
  6141.  
  6142.   MatchIt is syntax sensitive, so that it is semi-intelligent about
  6143.   how it finds the matching delimiter. For example, if a Pascal BEGIN
  6144.   is the specified selection, MatchIt finds the proper END that matches
  6145.   it. All commenting conventions, strings, nesting, and so on are taken
  6146.   into account when searching for the end delimiter.
  6147.  
  6148.   The functionality of MatchIt is similar to the Shell editor’s ability
  6149.   to find mates for the characters ( [ { and '' when you double-click
  6150.   any of these characters. However, MatchIt differs from the Shell
  6151.   editor by supporting even more delimiters and using the knowledge
  6152.   of the target language syntax to find the proper match. The following
  6153.   table summarizes all the delimiters supported and for which languages:
  6154.  
  6155.  
  6156.                              Examples
  6157.  
  6158.   matchit  mysource.p
  6159.  
  6160.   For the current selected delimiter in the open window mysource.p,
  6161.   find the delimiter's mate. The language is assumed to be Pascal (because
  6162.   of the .p suffix.). No message is reported and the selection is not
  6163.   changed if the mate cannot be found. Of course, errors are still
  6164.   reported to diagnostic output if the input selection is not a valid
  6165.   Pascal delimiter (according to the table in "Options"). If MatchIt
  6166.   is to be used explicitly, a more general form for its use is shown
  6167.   in this example:
  6168.  
  6169.   matchit  -n  "{target}"
  6170.  
  6171.   For the current selected delimiter in the open target window, find
  6172.   the delimiter’s mate. The "{target}" specification could have been
  6173.   omitted, as it is MatchIt’s default. If explicitly specified, as
  6174.   shown here, it is best to quote it. The language is determined by
  6175.   the window’s name suffix (if present), or by the the selection, if
  6176.   the suffix is not acceptable to MatchIt. An error is reported if
  6177.   the mate cannot be found (-n).
  6178.  
  6179.   While the second example is more general than the first, and either
  6180.   might be useful for Shell scripts (particularly when the -n option
  6181.   is used), the real use for MatchIt is as a generalization of the
  6182.   the Shell editor’s own double-clicking delimiter matching mechanism.
  6183.   The following example illustrates this purpose:
  6184.  
  6185.   addmenu Edit 'Match It/µ' 'matchit  -n -h ∂
  6186.   "{active}"  ≥ "{MPW}"Errors || ∂
  6187.   alert  < "{MPW}"Errors'
  6188.  
  6189.   This example places a MatchIt call into the Edit menu as the command
  6190.   Match It with a command key Option-m (the µ). A selection is made
  6191.   in the current (that is, the {active}) window and the menu command
  6192.   invoked (by pressing Command-Option-m). If the match is found, all
  6193.   characters from the initially selected delimiter to its mate are
  6194.   highlighted (-h). If a match is not found, or if any other errors
  6195.   occur, an alert dialog box appears containing the error message.
  6196.   An auxiliary file, "{MPW}"Errors, is used for this purpose.
  6197.  
  6198.   Of course, you might not be interested in displaying the dialog box
  6199.   because you can see that the selection doesn’t change if there are
  6200.   any errors. Furthermore, you might not want superfluous files laying
  6201.   around ("{MPW}"Errors—although you could create a more elaborate
  6202.   AddMenu command to always delete this file). Thus, you could make
  6203.   the following simplification:
  6204.  
  6205.   addmenu Edit 'Match It/µ' 'matchit  -h  "{active}"  ≥ dev:null'
  6206.  
  6207.   This example places a MatchIt call into the Edit menu but with all
  6208.   errors ignored when the MatchIt command is executed.
  6209.  
  6210.   Limitations MatchIt does not process conditionals (that is, Pascal
  6211.   $ifc, C #if, and so on) during its scan except to find matching pairs.
  6212.   This might confuse MatchIt’s scanning process. Similarily, C macros
  6213.   and "\" continuations may also confuse MatchIt.
  6214.  
  6215.   MatchIt only finds a right delimiter to the specified left delimiter.
  6216.   Right-to-left matching is not supported.
  6217.  
  6218. æKY MergeBranch
  6219. æC        MergeBranch -- merge a branch revision onto the trunk
  6220.  
  6221. MergeBranch file…
  6222.  
  6223. Status codes returned:
  6224.   0    No Errors.
  6225.   1    Syntax Error.
  6226.   2    Error in Processing.
  6227.   3    System Error.
  6228.  
  6229.                            Description
  6230.  
  6231.   Merge the branch revision of the HFS file file onto the trunk. The
  6232.   file must belong to a currently mounted project and must be a branch
  6233.   revision (that is, the revision number contains one or more letters).
  6234.  
  6235.   MergeBranch uses the ProjectInfo command to determine what project
  6236.   file belongs to and whether file is in fact a branch revision. If
  6237.   all of the file's revisions are older than the branch, the branch
  6238.   will be checked in as the latest trunk revision. Otherwise MergeBranch
  6239.   checks out the latest revision on the trunk and calls CompareFiles
  6240.   to allow the user to manually cut and paste changes from the branch
  6241.   into the trunk revision. When done, the user can check the modified
  6242.   trunk revision back into the project.
  6243.  
  6244.   MergeBranch uses the CompareFiles script.
  6245.  
  6246.  
  6247.                              Examples
  6248.  
  6249.   MergeBranch file.c
  6250.  
  6251.   This example merges the branch revision in the file "file.c" onto
  6252.   the trunk.
  6253.  
  6254.   AddMenu Project 'Merge Branch' 'Merge Branch {Active} ∑∑ {WorkSheet}'
  6255.  
  6256.   This example adds MergeBranch to the Project menu and allows you
  6257.   to merge branch revisions onto the trunk.
  6258.  
  6259.  
  6260.                              See also 
  6261.  
  6262.   CompareFiles.
  6263.  
  6264. æKY ModifyReadOnly
  6265. æC  ModifyReadOnly -- enables a read-only Projector file to be edited
  6266.  
  6267. ModifyReadOnly file …
  6268.  
  6269. Status codes returned:
  6270.   0    No errors.
  6271.   1    Syntax error.
  6272.   2    Error in processing.
  6273.  
  6274.                            Description
  6275.  
  6276.   Write-enable a file that has been checked out as read-only. After
  6277.   executing this command on a file, the modified read-only icon is
  6278.   displayed in the window.
  6279.  
  6280.   This command is most useful on those rare occasions when you need
  6281.   to modify a read-only file. For example, suppose you have taken a
  6282.   number of modifiable files home. You may have also brought along
  6283.   certain read-only copies of files that you did not expect to modify,
  6284.   but once you get into your work at home you discover that you do,
  6285.   after all, need to make changes in these files.
  6286.  
  6287.   Note that this command takes only a single file for a parameter.
  6288.   This "feature" was intentional so that this command would not be
  6289.   overused.
  6290.  
  6291.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6292.   symbols used in Projector commands.
  6293.  
  6294.  
  6295.                              Examples
  6296.  
  6297.   Suppose file.c is checked out as read-only. You can write-enable
  6298.   it by using the ModifyReadOnly command:
  6299.  
  6300.   ModifyReadOnly file.c
  6301.  
  6302.   ProjectInfo :file.c -s
  6303.  
  6304.   The ProjectInfo command writes the following to standard output:
  6305.  
  6306.   file.c,5*
  6307.  
  6308.   Notice that an asterisk appears after the revision number when you
  6309.   get information about modified read-only files.
  6310.  
  6311.  
  6312.                              See also 
  6313.  
  6314.   CheckIn, CheckOut, CheckOutDir.
  6315.  
  6316. æKY Mount
  6317. æC                        Mount -- mount volumes
  6318.  
  6319. Mount drive…
  6320.  
  6321. Status codes returned:
  6322.   0    The disk was mounted.
  6323.   1    Syntax error.
  6324.   2    An error occurred.
  6325.  
  6326.                            Description
  6327.  
  6328.   Mounts the disks in the specified drives, making them accessible
  6329.   to the file system. Drive is the drive number.
  6330.  
  6331.   Mounting is normally automatic when a disk is inserted. The Mount
  6332.   command is needed for mounting multiple hard disks, which cannot
  6333.   be "inserted," or for volumes that have been unmounted via the Unmount
  6334.   command.
  6335.  
  6336.  
  6337.                              Examples
  6338.  
  6339.   Mount 1
  6340.  
  6341.   Mounts the disk in drive 1 (the internal drive).
  6342.  
  6343.  
  6344.                              See also 
  6345.  
  6346.   Unmount and Volumes commands.
  6347.  
  6348. æKY MountProject
  6349. æC                    MountProject -- mount projects
  6350.  
  6351. MountProject ([-s] [-pp] [-q] [-r]) | [Project]
  6352.  -s                      # print names only, not commands
  6353.  -pp                     # list mounted projects using project paths
  6354.  -q                      # don't quote names with special characters
  6355.  -r                      # list projects recursively
  6356.  
  6357. Status codes returned:
  6358.   0    No errors.
  6359.   1    Syntax error.
  6360.   2    Error in processing.
  6361.   3    System error.
  6362.  
  6363.                            Description
  6364.  
  6365.   MountProject mounts (establishes a connection to) the specified project.
  6366.   Project is the HFS path of the project directory for the project.
  6367.   Once a project is mounted, that project and all its subprojects can
  6368.   be accessed.
  6369.  
  6370.   MountProject commands typically appear in the UserStartup file, a
  6371.   script, or an AddMenu to automatically mount the projects you typically
  6372.   access.
  6373.  
  6374.   If project is omitted, a list of all root projects is written to
  6375.   standard output in the form of MountProject commands.
  6376.  
  6377.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6378.   symbols used in Projector commands.
  6379.  
  6380.  
  6381.                              Examples
  6382.  
  6383.   MountProject FS:Zoom
  6384.   MountProject HD:localProjects:Test
  6385.  
  6386.   These commands mount the projects Zoom and Test.
  6387.  
  6388.   MountProject
  6389.   MountProject FS:MPW
  6390.   MountProject HD:localProjects:sort
  6391.  
  6392.   To obtain a list of the current root projects, execute the MountProject
  6393.   command without parameters.
  6394.  
  6395.  
  6396.                              See also 
  6397.  
  6398.   UnmountProject, Project, CheckOutDir.
  6399.  
  6400. æKY Move
  6401. æC                  Move -- move files and directories
  6402.  
  6403. Move [-y | -n | -c] [-p] name… target  ≥ progress
  6404.  -y                      # overwrite target files (avoids dialog)
  6405.  -n                      # don't overwrite target files (avoids dialog)
  6406.  -c                      # cancel if conflict occurs (avoids dialog)
  6407.  -p                      # write progress information to diagnostics
  6408.  
  6409. Status codes returned:
  6410.   0    All objects were moved.
  6411.   1    Syntax error.
  6412.   2    An error occurred during the move.
  6413.   4    Cancel was selected or implied with the -c option.
  6414.  
  6415.                            Description
  6416.  
  6417.   Moves name to targetName. (Name and targetName are file or directory
  6418.   names.) If targetName is a directory, one or more objects (files
  6419.   and/or directories) are moved into that directory. If targetName
  6420.   is a file or doesn’t exist, file or directory name replaces targetName.
  6421.   In either case, the old objects are deleted. Moved objects retain
  6422.   their current creation and modification dates.
  6423.  
  6424.   If a directory is moved, its contents, including all subdirectories,
  6425.   are also moved. No directory moved can be a parent of targetName.
  6426.  
  6427.   A dialog box requests a confirmation if the move would overwrite
  6428.   an existing file or folder. The -y, -n, or -c option can be used
  6429.   to avoid this interaction.
  6430.  
  6431.  
  6432.                              Examples
  6433.  
  6434.   Move Startup Suspend Resume Quit {SystemFolder}
  6435.  
  6436.   Moves the four files from the current directory to the System Folder.
  6437.  
  6438.   Move File ::
  6439.  
  6440.   Moves File from the current directory to the enclosing (parent) directory.
  6441.  
  6442.   Move -y File1 File2
  6443.  
  6444.   Moves File1 to File2, overwriting File2 if it exists. (This is the
  6445.   same as renaming the file.)
  6446.  
  6447.  
  6448.                              See also 
  6449.  
  6450.   Duplicate and Rename commands.
  6451.  
  6452.   "File and Window Names" in Chapter 4.
  6453.  
  6454.   "Filename Generation" in Chapter 5.
  6455.  
  6456. æKY MoveWindow
  6457. æC                 MoveWindow -- move window to h,v location
  6458.  
  6459. MoveWindow [h v] [-i] [window]
  6460.  h                       # horizontal position of top left corner
  6461.  v                       # vertical position of top left corner
  6462.  -i                      # ignore positioning errors
  6463.  
  6464. Status codes returned:
  6465.   0    No errors.
  6466.   1    Syntax error (error in parameters).
  6467.   2    The specified window does not exist.
  6468.   3    The h v location specified is invalid.
  6469.  
  6470.                            Description
  6471.  
  6472.   Moves the upper-left corner of the specified window to the location
  6473.   (h v), where h and v are horizontal and vertical integers, respectively.
  6474.   Use a space to separate the numbers h and v on the command line.
  6475.  
  6476.   The coordinates (0,0) are located at the left side of the screen
  6477.   at the bottom of the menu bar. If the location specified would place
  6478.   the window’s title bar entirely off the visible screen, an error
  6479.   is returned. (The -i option overrides the error.) If no window is
  6480.   specified, the target window (the second window from the front) is
  6481.   assumed. If no location is specified, the specified window’s location
  6482.   is returned without any effect on the window.
  6483.  
  6484.  
  6485.                              Examples
  6486.  
  6487.   MoveWindow 72 72
  6488.  
  6489.   Moves the target window’s upper-left corner to a point approximately
  6490.   one inch in from the upper-left corner of the screen, and one inch
  6491.   below the bottom of the menu bar. (There are about 72 pixels per
  6492.   inch on the Macintosh display screen.)
  6493.  
  6494.   MoveWindow
  6495.  
  6496.   Returns MoveWindow 72 72 when executed after the above example.
  6497.  
  6498.   MoveWindow 0 0 {Worksheet}
  6499.  
  6500.   Moves the Worksheet window to the upper-left corner of the screen
  6501.   (below the menu bar).
  6502.  
  6503.  
  6504.                              See also 
  6505.  
  6506.   SizeWindow, StackWindows, RotateWindows, TileWindows, and ZoomWindow
  6507.   commands.
  6508.  
  6509. æKY NameRevisions
  6510. æC                NameRevisions -- define a symbolic name
  6511.  
  6512. NameRevisions [-u User] [-project Project] [-public |private | -b] [-r]
  6513.      [[-only] | name [[-expand] [-s] | [-replace] [-dynamic] [names… | -a]]]
  6514.  -u user                 # name of current user
  6515.  -private                # create a private name
  6516.  -project project        # name of project that contains the revisions
  6517.  -public                 # create a public name
  6518.  -b                      # print both public and private names
  6519.  -expand                 # evaluate names to revision level before printing
  6520.  -only                   # only print the names, not the associated revisions
  6521.  -replace                # completely overwrite the previous definition of name
  6522.  -dynamic                # evaluate names to revision level when using not defining
  6523.  -r                      # recursively execute NameRevisions starting with current project
  6524.  -s                      # print a single name per line
  6525.  -a                      # all the files in the project
  6526.  
  6527. Status codes returned:
  6528.   0    No errors.
  6529.   1    Syntax error.
  6530.   2    Error in processing.
  6531.   3    System error.
  6532.  
  6533.                            Description
  6534.  
  6535.   Create a symbolic name to represent a set of revisions under Projector.
  6536.   Subsequently, when name is used in Projector commands, its value,
  6537.   names, is substituted in its place. Symbolic names are kept on a
  6538.   per-project basis and can be composed of filenames, revisions, branches,
  6539.   and other defined symbolic names. A symbolic name can include only
  6540.   one revision per file. The first character of a Name cannot be a
  6541.   digit (0–9). Also, commas, greater-than or less-than signs, (<, <,
  6542.   > >), or hyphens (-) are not allowed anywhere in a Name. Names are
  6543.   not case sensitive.
  6544.  
  6545.   If names is missing, the definition for name is listed. If name is
  6546.   missing, then NameRevisions lists all symbolic names in the project.
  6547.   In either case, the output is in the form of NameRevisions commands.
  6548.  
  6549.   By default, if names currently refers to a file listed in name, the
  6550.   revision for the file in name is modified to be the revision associated
  6551.   with the file in names. If there is a file in names which is not
  6552.   currently referred to by name, that file and revision is appended
  6553.   to name. To replace the definition of name, include the
  6554.  
  6555.   -replace option.
  6556.  
  6557.   The default is to create a private symbolic name. Include the -public
  6558.   option to make the symbolic name available to all users. You can
  6559.   add definitions for private symbolic names to UserStartup. Public
  6560.   symbolic name are stored with the project so they need to be defined
  6561.   only once. Do not put public symbolic name definitions in UserStartup.
  6562.  
  6563.   Projector checks for various errors both when a symbolic name is
  6564.   defined and when it is used. Errors include referring to a nonexistent
  6565.   file or referring to more than one revision in a file.
  6566.  
  6567.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6568.   symbols used in Projector commands.
  6569.  
  6570.  
  6571.                              Examples
  6572.  
  6573.   Assuming the latest revisions of the files file.c and interactive.c
  6574.   are 9 and 13 respectively, the first example defines a symbolic name
  6575.   "Work" that always expands to the files file.c,9 and interactive.c,13.
  6576.  
  6577.   NameRevisions Work file.c interactive.c
  6578.  
  6579.   The following command:
  6580.  
  6581.   CheckOut Work
  6582.  
  6583.   Is equivalent to:
  6584.  
  6585.   CheckOut file.c,9 interactive.c,13
  6586.  
  6587.   By omitting the Names parameter, the next NameRevisions command generates
  6588.   the current definition of Work.
  6589.  
  6590.   NameRevisions Work
  6591.   NameRevisions Work file.c,9 interactive.c,13
  6592.  
  6593.   The -dynamic is an important option. The following two commands illustrate
  6594.   its function:
  6595.  
  6596.   NameRevisions fred file.c
  6597.   NameRevisions -dynamic fred file.c
  6598.  
  6599.   The first command defines a symbolic name "fred" that always expands
  6600.   to the latest revision of file.c when fred was defined. The second
  6601.   example expands to the latest revision at the time of use. If the
  6602.   latest revision of file.c at the time fred was defined was 7 and
  6603.   the current latest revision is 9, the second NameRevisions command
  6604.   is equivalent to
  6605.  
  6606.   NameRevisions fred file.c,9
  6607.  
  6608.   The next command creates the symbolic name "file.c" that expands
  6609.   to the second revision off the first branch off the 1.1 revision
  6610.   of file.c.
  6611.  
  6612.   NameRevisions file.c file.c,1.1a2
  6613.  
  6614.   The command
  6615.  
  6616.   CheckOut file.c
  6617.  
  6618.   checks out revision 1.1a2 of file.c. The next example creates a Name
  6619.   "file.c" that expands to the latest version of the first branch off
  6620.   the 1.1 revision of file.c.
  6621.  
  6622.   NameRevisions -dynamic file.c file.c,1.1a
  6623.  
  6624.   So the checkout command
  6625.  
  6626.   CheckOut file.c
  6627.  
  6628.   will check out the latest revision on the first branch off revision
  6629.   1.1 of file.c.
  6630.  
  6631.   The next example defines all the latest revisions in the project
  6632.   Kerfroodi to be part of "v1.0 B1". Because this a global name, all
  6633.   users accessing the Kerfroodi project will be able to use the name
  6634.   "v1.0 B1".
  6635.  
  6636.   NameRevisions -public "vB1 1.0" -project Kerfroodi -a
  6637.  
  6638.   The name "BetaRelease" is defined recursively for all projects within
  6639.   the Zoom project:
  6640.  
  6641.   NameRevisions -project Zoom∫ -r "BetaRelease" -a
  6642.  
  6643.   Its behavior is the same as executing the following commands individually:
  6644.  
  6645.   NameRevisions -project Zoom "BetaRelease" -a
  6646.   NameRevisions -project Zoom∫Vroom "BetaRelease" -a
  6647.   NameRevisions -project Zoom∫Utilities "BetaRelease" -a
  6648.   NameRevisions -project Zoom∫Utilities∫Port "BetaRelease" -a
  6649.   ...
  6650.  
  6651.  
  6652.                              See also 
  6653.  
  6654.   ProjectInfo, DeleteNames.
  6655.  
  6656. æKY New
  6657. æC                       New -- open a new window
  6658.  
  6659. New [name…]
  6660.  
  6661. Status codes returned:
  6662.   0    No errors.
  6663.   1    Syntax error (error in parameters).
  6664.   2    Unable to complete operation; a file with the specified name already exists.
  6665.   3    System error.
  6666.  
  6667.                            Description
  6668.  
  6669.   Opens a new window as the active (frontmost) window. If name is not
  6670.   specified, the Shell generates a unique name for the new window,
  6671.   of the form "Untitled-n", where n is a decimal number. If name already
  6672.   exists, an error results.
  6673.  
  6674.   You can use New to open several new windows by specifying a list
  6675.   of names separated by spaces. Note that New differs from Open -n
  6676.   by returning an error if the file already exists, whereas Open -n
  6677.   either opens an existing file or creates a new file.
  6678.  
  6679.   If the Shell variable {NewWindowRect} is defined, the windows are
  6680.   opened to that size and location.
  6681.  
  6682.  
  6683.                              Examples
  6684.  
  6685.   New
  6686.  
  6687.   Opens a new window with a Shell-generated name.
  6688.  
  6689.   New Test.a Test.p Test.c
  6690.  
  6691.   Creates three windows called Test.a, Test.p, and Test.c.
  6692.  
  6693.  
  6694.                              See also 
  6695.  
  6696.   Open command.
  6697.  
  6698. æKY Newer
  6699. æC             Newer -- compare modification dates of files
  6700.  
  6701. Newer [-c] [-e] [-q] file… target > newer
  6702.  -c               # compare creation dates
  6703.  -e               # report names that have same (equal) mod date as target
  6704.  -q               # don't quote file names with special characters
  6705.  
  6706. Status codes returned:
  6707.   0    No error.
  6708.   1    Syntax error.
  6709.   2    File not found.
  6710.  
  6711.                            Description
  6712.  
  6713.   Compares the modification dates of name and target. Files that have
  6714.   a more recent modification date than target have their names written
  6715.   to standard output. If the target is a nonexistent file or directory,
  6716.   all names that exist are considered newer than the target.
  6717.  
  6718.  
  6719.                              Examples
  6720.  
  6721.   Newer main.c main.c.bak
  6722.  
  6723.   Writes out main.c if its modification date is more recent than its
  6724.   backup.
  6725.  
  6726.   Newer HD:Source:≈.c HD:TimeStamp
  6727.  
  6728.   Writes to the screen all the source files in the Source directory
  6729.   that have been modified since the modification date of TimeStamp.
  6730.  
  6731.   If `Newer main.c main.c.bak`
  6732.     Duplicate main.c main.c.bak
  6733.   End
  6734.  
  6735.   Makes a backup copy of main.c only if it has been modified since
  6736.   the last backup was made.
  6737.  
  6738.   If "`Newer File.c File.h File.c.o`"
  6739.     C File.c -o file.c.o
  6740.   End
  6741.  
  6742.   Rebuilds the source file file.c if either file.c or file.h has been
  6743.   modified since file.c.o was last built.
  6744.  
  6745. æKY NewFolder
  6746. æC                   NewFolder -- create a new folder
  6747.  
  6748. NewFolder name…
  6749.  
  6750. Status codes returned:
  6751.   0    Folders were created for each name listed.
  6752.   1    Syntax error.
  6753.   2    An error occurred.
  6754.   3    Attempt to use NewFolder on a non-HFS volume.
  6755.  
  6756.                            Description
  6757.  
  6758.   Creates new directories with the names specified. Any parent directories
  6759.   included in the name specification must already exist.
  6760.  
  6761.     • Note: This command can be used only on hierarchical file system
  6762.     (HFS) disks.
  6763.  
  6764.  
  6765.                              Examples
  6766.  
  6767.   NewFolder Memos
  6768.  
  6769.   Creates Memos as a subdirectory of the current directory.
  6770.  
  6771.   NewFolder Parent :Parent:Kid
  6772.  
  6773.   Creates Parent as a subdirectory of the current directory, and Kid
  6774.   as a subdirectory of Parent.
  6775.  
  6776. æKY NewProject
  6777. æC                  NewProject -- create a new project
  6778.  
  6779. NewProject -w | -close | ([-u user] [-cs comment | -cf file] project)
  6780.  -cf file                # the comment is contained in file.
  6781.  -close                  # close the New Project window
  6782.  -cs comment             # a short description of the project
  6783.  -w                      # open the New Project window
  6784.  -u user                 # name of current user
  6785.  
  6786. Status codes returned:
  6787.   0    No errors.
  6788.   1    Syntax error.
  6789.   2    Error in processing.
  6790.   3    System error.
  6791.  
  6792.                            Description
  6793.  
  6794.   NewProject creates a project under control of Projector. A project
  6795.   directory is created to store the files, subprojects, and other information
  6796.   related to the project. The name of the directory is the name of
  6797.   the project.
  6798.  
  6799.   If project is a project pathname (such as MPW∫Tools∫Enterprise),
  6800.   Projector creates Enterprise as a subproject of the existing MPW∫Tools
  6801.   project. In this case MPW∫Tools must be a mounted project (see the
  6802.   MountProject command).
  6803.  
  6804.   If project is a leafname (such as Enterprise), project directory
  6805.   Enterprise is created in the current directory.
  6806.  
  6807.   Finally, if project is a partial or full HFS pathname (such as :Work:Enterprise
  6808.   or FS:Projects:Enterprise), the project Enterprise is created in
  6809.   the HFS location specified.
  6810.  
  6811.   Add a MountProject command to the UserStartup file, a script, or
  6812.   AddMenu to easily mount the new project.
  6813.  
  6814.   The checkout directory is initially set to the current directory
  6815.   (:). To change the checkout directory, refer to the CheckOutDir command.
  6816.  
  6817.   To add files to the new project, use the CheckIn command (with the
  6818.   -new option) or the Check In window.
  6819.  
  6820.   See Chapter 7 of the MPW manual for complete definitions of the terms and
  6821.   symbols used in Projector commands.
  6822.  
  6823.  
  6824.                              Examples
  6825.  
  6826.   The following command creates a project Enterprise in the current
  6827.   directory. No comment is saved with the project, but you can add
  6828.   one later by selecting the project in the Check Out window's /Info
  6829.   view.
  6830.  
  6831.   NewProject Enterprise
  6832.  
  6833.   The next example creates a project Zoom in the FS:work:Zoom. The
  6834.   -cf option indicates that the comment for the new project is contained
  6835.   in the file Info.
  6836.  
  6837.   NewProject FS:work:Zoom -cf Info
  6838.  
  6839.   Finally, given that the project Enterprise∫Utilities exists and has
  6840.   been mounted using the MountProject command, the next command creates
  6841.   a Zoom project in the Enterprise∫Utilities project. In this case
  6842.   you don’t need to add a MountProject command to UserStartup, but
  6843.   you may want to add a CheckOutDir command to set the checkout directory.
  6844.  
  6845.   NewProject Enterprise∫Utilities∫Zoom -cs ∂
  6846.   "Upgrade Zoom utility"
  6847.  
  6848.  
  6849.                              See also 
  6850.  
  6851.   CheckOutDir, MountProject, Project.
  6852.  
  6853. æKY Open
  6854. æC                  Open -- open file(s) in window(s)
  6855.  
  6856. Open [-n | -r] [-t] [name…]
  6857.  -n                      # open new file (default name Untitled)
  6858.  -r                      # open file for read-only use
  6859.  -t                      # open file as the target window
  6860.  
  6861. Status codes returned:
  6862.   0    No errors.
  6863.   1    Error in parameters.
  6864.   2    Unable to complete operation; specified file not found.
  6865.   3    System error.
  6866.  
  6867.                            Description
  6868.  
  6869.   Opens a file as the active (frontmost) window. If name is not specifed,
  6870.   StdFile’s GetFile routine is called, allowing you to use a dialog
  6871.   box to choose a file. If name is already open as a window, that window
  6872.   becomes the active (frontmost) window.
  6873.  
  6874.  
  6875.                              Examples
  6876.  
  6877.   Open
  6878.  
  6879.   Displays StdFile from which to choose a file to open.
  6880.  
  6881.   Open -r -t Test.a
  6882.  
  6883.   Opens the file Test.a as the target window, read-only.
  6884.  
  6885.   Open ≈.a
  6886.  
  6887.   Opens all the files that end with ".a".
  6888.  
  6889.  
  6890.                              See also 
  6891.  
  6892.   Target, New, and Close commands.
  6893.  
  6894. æKY OrphanFiles
  6895. æC  OrphanFiles -- remove Projector information from a list of files
  6896.  
  6897. OrphanFiles file…
  6898.  
  6899. Status codes returned:
  6900.   0    No errors.
  6901.   1    Syntax error.
  6902.   2    Error in processing.
  6903.  
  6904.                            Description
  6905.  
  6906.   Remove the 'CKID' resource from file(s). This removes the identification
  6907.   information from the file that Projector uses to uniquely identify it.
  6908.  
  6909.     • Warning Once the projector information is removed from a file,
  6910.     you cannot check the file back into the Project as a checked-out
  6911.     file.
  6912.  
  6913.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  6914.   symbols used in Projector commands.
  6915.  
  6916.  
  6917.                              Examples
  6918.  
  6919.   Suppose file.c and interactive.c belong to a project that has been
  6920.   deleted. We can remove the Projector information from them (so that
  6921.   they can be used for other purposes) with the command
  6922.  
  6923.   OrphanFiles file.c interactive.c
  6924.  
  6925.  
  6926.                              See also 
  6927.  
  6928.   TransferCkid.
  6929.  
  6930. æKY Parameters
  6931. æC                    Parameters -- write parameters
  6932.  
  6933. Parameters [parameter…]  > parameters
  6934.  
  6935. Status codes returned:   
  6936.   0    no errors is always returned.
  6937.  
  6938.                            Description
  6939.  
  6940.   The Parameters command writes its parameters, including its name,
  6941.   to standard output. The parameters are written one per line, and
  6942.   each is preceded by its parameter number (in braces) and a blank.
  6943.   This command is useful for checking the results of variable substitution,
  6944.   command substitution, quoting, blank interpretation, and filename
  6945.   generation.
  6946.  
  6947.  
  6948.                              Examples
  6949.  
  6950.   Parameters One Two "and Three"
  6951.  
  6952.   Writes the following four lines to standard output:
  6953.  
  6954.   {0} Parameters
  6955.   {1} One
  6956.   {2} Two
  6957.   {3} and Three
  6958.  
  6959.   Recall that "…" and '…' quotation marks are removed before parameters
  6960.   are passed to commands.
  6961.  
  6962.  
  6963.                              See also 
  6964.  
  6965.   Echo and Quote commands.
  6966.  
  6967.   "Parameters to Scripts" in Chapter 5.
  6968.  
  6969. æKY Pascal
  6970. æC                      Pascal -- Pascal compiler
  6971.  
  6972. Pascal [option…] [file…]  < file ≥ progress
  6973.     -b                   # generate A5 references for procedure addresses
  6974.     -c                   # syntax check only, don't create object file
  6975.     -clean               # erase all symbol table resources
  6976.     -d name=(TRUE|FALSE) # set compile time variable name
  6977.     -e file              # write errors to file
  6978.     -forward             # allow only explicit forward and external object declarations
  6979.     -h                   # suppress error messages regarding unsafe handles
  6980.     -i directory,…       # search for includes in directory,…
  6981.     -k directory         # create symbol table resource files in directory
  6982.     -m                   # allow greater than 32K globals by using 32 bit
  6983.     -mbg ch8             # include v2.0 compatible MacsBug symbols
  6984.     -mbg full            # include full (untruncated) symbols for MacsBug
  6985.     -mbg off             # don't include symbols for MacsBug
  6986.     -mbg number          # include MacsBug symbols truncated to length 
  6987.                          # number
  6988.     -mc68020             # generate MC68020 code 
  6989.     -mc68881             # generate MC68881 code for floating point operations
  6990.      -model farCode|     # generate load-time relocatable 32-bit references for
  6991.          farData|far     #   code, data, or both
  6992.      -model nearCode|    # generate 16-bit references for code, data, or both 
  6993.          nearData|near   #   (the default)
  6994.     -n                   # generate separate global data modules for better allocation
  6995.     -noload              # don't use or create any symbol table resources
  6996.     -o objname           # generate code in file or directory objname
  6997.     -only name…          # only generate code for named modules
  6998.     -ov                  # generate code to test for overflow
  6999.     -opt off             # don't apply code optimizations
  7000.     -opt on | full       # choose level of code optimization (full is default);
  7001.                          #   can modify with [,nopeep] [,nostatic]
  7002.     -p                   # write progress information to diagnostics
  7003.     -r                   # don't generate range checking code
  7004.     -rebuild             # rebuild all symbol table resources
  7005.     -sym off             # don't generate SADE records
  7006.     -sym on | full       # generate SADE records; can modify with [,nolines] [,notypes] [,novars]
  7007.     -t                   # write compilation time to diagnostics
  7008.     -u                   # initialize all data to $7267 for debugging use
  7009.     -w                   # don't perform peephole optimization
  7010.     -y directory         # create temporary files in directory
  7011.  
  7012. Status codes returned:
  7013.   0    Successful completion.
  7014.   1    Error in parameters.
  7015.   2    Compilation halted.
  7016.  
  7017.                            Description
  7018.  
  7019.   Compiles the specified Pascal source files (programs or units). You
  7020.   can specify zero or more filenames. Each file is compiled separately—compiling
  7021.   file Name .p creates object file Name .p.o. By convention, Pascal
  7022.   source filenames end in a ".p" suffix.
  7023.  
  7024.   See the MPW 3.0 Pascal Reference for details of the language definition.
  7025.  
  7026.  
  7027.                              Examples
  7028.  
  7029.   Pascal Sample.p
  7030.  
  7031.   Compiles the Sample program provided in the PExamples folder.
  7032.  
  7033.   Pascal File1.p File2.p -r
  7034.  
  7035.   Compiles File1.p and File2.p, producing object files File1.p.o and
  7036.   File2.p.o but performing no range checking.
  7037.  
  7038.     • Note: Listing files are not produced directly by the compiler.
  7039.     Refer to the PasMat and PasRef tools.
  7040.  
  7041.   Availability The MPW Pascal compiler is available as a separate Apple
  7042.   product.
  7043.  
  7044.  
  7045.                              See also 
  7046.  
  7047.   PasMat and PasRef commands.
  7048.  
  7049.   MPW 3.0 Pascal Reference.
  7050.  
  7051. æKY PasMat
  7052. æC                  PasMat -- Pasca programs formatter
  7053.  
  7054. PasMat [option…] [input [output]]  < input > output ≥ progress
  7055.  -a                      # set a-  disable CASE label bunching
  7056.  -b                      # set b+  enable IF bunching
  7057.  -body                   # set body+ to disable indenting procedure bodies
  7058.  -c                      # set c+  suppress Return before BEGIN
  7059.  -d                      # set d+  use {…} comment delimiters
  7060.  -e                      # set e+  capitalize identifiers
  7061.  -entab                  # replace multiple blanks with tabs
  7062.  -f                      # set f-  disable formatting
  7063.  -g                      # set g+  group assignment and call statements
  7064.  -h                      # set h-  disable FOR, WHILE, WITH bunching
  7065.  -i directory,…          # search for includes in directory,…
  7066.  -in                     # set in+ process includes
  7067.  -k                      # set k+  indent statements between BEGIN and END
  7068.  -l                      # set l+  literally copy reserved words, identifiers
  7069.  -list file              # write listings to file
  7070.  -n                      # set n+  group formal parameters
  7071.  -o width                # set output line width (default 80)
  7072.  -p                      # write progress information to diagnostics
  7073.  -pattern -old-new-      # modify include names, changing old to new
  7074.  -q                      # set q+  no special ELSE IF formatting
  7075.  -r                      # set r+  upper case reserved words
  7076.  -rec                    # set rec+ to indent field lists under defined id
  7077.  -s file                 # substitute identifiers based on pairs in file
  7078.  -t tab                  # set output tab setting (default 2)
  7079.  -u                      # rename identifiers to match first occurence
  7080.  -v                      # set v+  put THEN on separate line
  7081.  -w                      # set w+  upper case identifiers
  7082.  -x                      # set x+  suppress space around operators
  7083.  -y                      # set y+  suppress space around :=
  7084.  -z                      # set z+  suppress space after commas
  7085.  -:                      # set :+  align colons in VAR declarations
  7086.  -@                      # set @+  multiple CASE tags on separate lines
  7087.  -∂#                     # set #+  smart grouping of assignments and calls
  7088.  -_                      # set _+  delete _ from identifiers
  7089.  
  7090. Status codes returned:
  7091.   0    Normal termination.
  7092.   1    Parameter or option error.
  7093.  
  7094.                            Description
  7095.  
  7096.   Reformats Pascal source code into a standard format, suitable for
  7097.   printouts or compilation. PasMat accepts full programs, external
  7098.   procedures, blocks, and groups of statements.
  7099.  
  7100.     • Note: A syntactically incorrect program causes PasMat to abort.
  7101.     If this happens, the generated output will contain the formatted
  7102.     source up to the point of the error.
  7103.  
  7104.   PasMat options let you do the following:
  7105.  
  7106.     • Convert a program to uniform case conventions.
  7107.  
  7108.     • Indent a program to show its logical structure, and adjust
  7109.     lines to fit into a specified line length.
  7110.  
  7111.     • Change the comment delimiters ( * * ) to { } .
  7112.  
  7113.     • Remove the underscore character ( _ ) from identifiers, rename
  7114.     identifiers, or change their case.
  7115.  
  7116.     • Format include files named in MPW Pascal include directives.
  7117.  
  7118.   PasMat specifications can be made through PasMat options or through
  7119.   special formatter directives, which resemble Pascal compiler directives,
  7120.   and are inserted into the source file as Pascal comments. PasMat’s
  7121.   default formatting is straightforward and does not require you to
  7122.   use any options. The best way to find out how PasMat formats something
  7123.   is to try out a small example.
  7124.  
  7125.   See Appendix K of the MPW 3.0 Pascal Reference for details of PasMat
  7126.   directives and their functions. The first dialog box of the Pascal
  7127.   Commando dialog is reproduced here for your convenience.
  7128.  
  7129.  
  7130.                              Examples
  7131.  
  7132.   Pasmat -n -u -r -d -pattern "==formatted/=" Sample.p ∂
  7133.   "formatted/Sample.p"
  7134.  
  7135.   Formats the file Sample.p with the -n, -u, -r, and -d options and
  7136.   writes the output to the file "formatted/Sample.p". Include files
  7137.   are processed
  7138.  
  7139.   ( -pattern ), and each Pascal compiler $I include file causes additional
  7140.   output files to be generated. Each of these files is created with
  7141.   the name "formatted/ filename ", where filename is the filename specified
  7142.   in the corresponding include. (The -pattern parameter contains a
  7143.   null pattern (==) with "formatted/" as a replacement string—a null
  7144.   pattern always matches the start of a string.)
  7145.  
  7146.   Care must be taken when a command line contains quotes, slashes,
  7147.   or other special characters that are processed by the Shell itself.
  7148.   In this example, we used the slash character, so the strings containing
  7149.   it had to be quoted.
  7150.  
  7151.   Limitations PasMat has these limitations:
  7152.  
  7153.     • The maximum length of an input line is 255 characters.
  7154.  
  7155.     • The maximum output line length is 150 characters.
  7156.  
  7157.     • The input files and output files must be different.
  7158.  
  7159.     • Only syntactically correct programs, units, blocks, procedures,
  7160.     and statements are formatted. This limitation must be taken into
  7161.     consideration when separate MPW 3.0 include files and conditional
  7162.     compiler directives are to be formatted.
  7163.  
  7164.     • The Pascal include directive should be the last thing on the
  7165.     input line if include files are to be processed. Include files
  7166.     are processed to a maximum nesting depth of five. All include
  7167.     files not processed are summarized at the end of formatting.
  7168.     (This assumes, of course, that the in directive/option is in
  7169.     effect.)
  7170.  
  7171.     • The identifiers CYCLE and LEAVE are treated as reserved Pascal
  7172.     keywords by PasMat. They are treated as two loop control statements
  7173.     by Pascal unless explicitly declared.
  7174.  
  7175.     • While Pasmat supports Pascal’s $$Shell facility in include
  7176.     files, the processing of MPW’s {PInterfaces} files is not fully
  7177.     supported because these files conditionally include files (remember,
  7178.     conditionals are not processed). For this reason, do not use
  7179.     the -in or -e option to process files that include MPW {PInterfaces}
  7180.     files.
  7181.  
  7182.   Availability PasMat is available as part of a separate Apple product,
  7183.   MPW 3.0 Pascal .
  7184.  
  7185.  
  7186.                              See also 
  7187.  
  7188.   Pascal and PasRef commands.
  7189.  
  7190.   Appendix K of the MPW 3.0 Pascal Reference.
  7191.  
  7192. æKY PasRef
  7193. æC                  PasRef -- Pascal cross-referencer
  7194.  
  7195. PasRef [option…] [file…]  < file > crossReference ≥ progress
  7196.  -a                      # process includes and units each time encountered
  7197.  -c                      # process includes and units only once
  7198.  -cond                   # process $SETC and $IFC, $ELSEC, $ENDC conditionals
  7199.  -d                      # process each file separately
  7200.  -d name=TRUE|FALSE      # set $SETC variable name to TRUE or FALSE
  7201.  -i directory,…          # search for includes in directory,…
  7202.  -l                      # write identifiers in lower case
  7203.  -mc68020                # source contains {$IFC OPTION(MC68020)} directives
  7204.  -mc68881                # source contains {$IFC OPTION(MC68881)} directives
  7205.  -n                      # don't process USES or includes
  7206.  -ni | -noi[ncludes]     # don't process include files
  7207.  -nl | -nol[istings]     # don't list the input
  7208.  -nolex                  # don't write lexical information
  7209.  -nt | -not[otal]        # don't write total line count
  7210.  -nu | -nou[ses]         # don't process USES declarations   
  7211.  -o                      # source written using Object Pascal
  7212.  -p                      # write progress information to diagnostics
  7213.  -s                      # don't write include and USES filenames
  7214.  -t                      # cross reference by total line number
  7215.  -u                      # write identifiers in upper case
  7216.  -w width                # set output line width (default 110)
  7217.  -x width                # set maximum identifier width
  7218.  
  7219. Status codes returned:
  7220.   0    Normal termination.
  7221.   1    Parameter or option error.
  7222.  
  7223.                            Description
  7224.  
  7225.   Reads Pascal source files and writes a listing of the source followed
  7226.   by a cross-reference listing of all identifiers. Each identifier
  7227.   is listed in alphabetical order, followed by the number of the line
  7228.   on which it appears. Line numbers can refer to the entire source
  7229.   file, or can be relative to individual include files and units. Each
  7230.   reference indicates whether the identifier is defined, assigned,
  7231.   or simply named (for example, used in an expression).
  7232.  
  7233.   See the MPW 3.0 Pascal Reference for more information about the Pascal
  7234.   language. The first dialog box of PasRef’s Commando dialog is reproduced
  7235.   here for your convenience.
  7236.  
  7237.   Identifiers may be up to 63 characters long and are displayed in
  7238.   their entirety unless overridden with the -x directive. Identifiers
  7239.   can remain as they appear in the input, or they can be converted
  7240.   to all lowercase (-l ) or all uppercase (-u).
  7241.  
  7242.   For include files, line numbers are relative to the start of the
  7243.   include file; an additional key number indicates which include file
  7244.   is referred to. A list of each include file processed and its associated
  7245.   key number is displayed prior to the cross-reference listing.
  7246.  
  7247.   USES declarations can also be processed by PasRef (their associated
  7248.   $U filename compiler directives are processed as in the Pascal compiler).
  7249.   These declarations are treated exactly like includes, and, as with
  7250.   the compiler, only the outermost USES declaration is processed (that
  7251.   is, a used unit’s USES declaration is not processed).
  7252.  
  7253.   As an alternative to processing USES declarations, PasRef accepts
  7254.   multiple source files. Thus you cross-reference a set of main programs
  7255.   together with the units they use. All the sources are treated like
  7256.   include files for display purposes. In addition, PasRef checks to
  7257.   see whether it has already processed a file (for example, if it appeared
  7258.   twice on the input list, or if one of the files already used or included
  7259.   it). The file is skipped it has already been processed.
  7260.  
  7261.  
  7262.                              Examples
  7263.  
  7264.   PasRef -nu -w 80 Memory.p > Memory.p.Xref
  7265.  
  7266.   Cross-references the sample desk accessory Memory.p and writes the
  7267.   output to the file Memory.p.Xref. No USES declarations are processed
  7268.   (-nu). The following source and cross-reference listings are generated:
  7269.  
  7270.   1 1 1 -- {
  7271.   2 1 2 -- File Memory.p
  7272.   3 1 3 --
  7273.   4 1 4 -- Copyright Apple Computer, Inc. 1985-1987
  7274.   5 1 5 -- All rights reserved.
  7275.   6 1 6 -- }
  7276.   7 1 7 --
  7277.   8 1 8 -- {$D+} { MacsBug symbols on }
  7278.   9 1 9 -- {$R-} { No range checking }
  7279.   10 1 10 --
  7280.   11 1 11 -- UNIT Memory;
  7281.   12 1 12 --
  7282.   13 1 13 -- INTERFACE
  7283.   14 1 14 --
  7284.   15 1 15 -- USES
  7285.   16 1 16 -- MemTypes, QuickDraw, OSIntf, ToolIntf, PackIntf;
  7286.   17 1 17 --
  7287.   18 1 18 --
  7288.   19 1 19 -- FUNCTION DRVROpen (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7289.   20 1 20 -- FUNCTION DRVRControl (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7290.   21 1 21 -- FUNCTION DRVRStatus (ctlPB: ParmBlkPtr; dCtl:.DCtlPtr):OSErr;
  7291.   22 1 22 -- FUNCTION DRVRPrime (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7292.   23 1 23 -- FUNCTION DRVRClose (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7293.   24 1 24 --
  7294.   25 1 25 --
  7295.   26 1 26 -- IMPLEMENTATION
  7296.   etc.
  7297.  
  7298.   63 1 63 --A FUNCTION DRVRClose (ctlPB: ParmBlkPtr; dCtl: DCtlPtr):OSErr;
  7299.   64 1 64 0-A BEGIN
  7300.   65 1 65 -- IF dCtl^.dCtlwindow <> NIL THEN
  7301.   66 1 66 1- BEGIN
  7302.   67 1 67 -- DisposeWindow (WindowPtr(dCtl^.dCtlWindow));
  7303.   68 1 68 -- dCtl^.dCtlWindow := NIL;
  7304.   69 1 69 -1 END;
  7305.   70 1 70 -- DRVRClose := NOErr;
  7306.   71 1 71 -0A END;
  7307.   etc.
  7308.  
  7309.   178 1 178 --
  7310.   179 1 179 -- END. {of memory UNIT}
  7311.   180 1 180 --
  7312.  
  7313.   Each line of the source listing is preceded by five columns of information:
  7314.  
  7315.   1. The total line count.
  7316.  
  7317.   2. The include key assigned by PasRef for an include or USES file.
  7318.   (See below.)
  7319.  
  7320.   3. The line number within the include or main file.
  7321.  
  7322.   4. Two indicators (left and right) that reflect the static block
  7323.   nesting level. The left indicator is incremented (mod 10) and displayed
  7324.   whenever a BEGIN, REPEAT, or CASE is encountered. On termination
  7325.   of these structures with an END or UNTIL, the right indicator is
  7326.   displayed, then decremented. It is thus easy to match BEGIN, REPEAT,
  7327.   and CASE statements with their matching terminations.
  7328.  
  7329.   5. A letter that reflects the static level of procedures. The character
  7330.   is updated for each procedure nest level ("A" for level 1, "B" for
  7331.   level 2, and so on), and displayed on the line containing the heading,
  7332.   and on the BEGIN and END associated with the procedure body. Using
  7333.   this column you can easily find the procedure body for a procedure
  7334.   heading when there are nested procedures declared between the heading
  7335.   and its body.
  7336.  
  7337.   The cross-reference listing follows:
  7338.  
  7339.   1. Memory.p
  7340.  
  7341.   -A-
  7342.  
  7343.   accEvent 144 ( 1)
  7344.   accRun 158 ( 1)
  7345.   ApplicZone 121 ( 1)
  7346.   Away 33* ( 1) 146 ( 1)
  7347.  
  7348.   -B-
  7349.  
  7350.   BeginUpdate 151 ( 1)
  7351.   BNOT 39 ( 1)
  7352.   Bold ( 1) 117 ( 1)
  7353.   Boolean 31* ( 1)
  7354.   BOR 39 ( 1)
  7355.   BSL 39 ( 1)
  7356.  
  7357.   -C-
  7358.  
  7359.   csCode 143 ( 1)
  7360.   CSParam 146 ( 1)
  7361.   ctlPB 19* ( 1) 20*( 1) 21*( 1) 22*( 1)..23*( 1) 43*( 1)
  7362.         63* ( 1) 74*( 1) 143 ( 1) 146 ( 1) 168*( 1) 173*( 1)
  7363.  
  7364.   -D-
  7365.  
  7366.   dCtl 19* ( 1) 20*( 1) 21*( 1) 22*( 1) 23*( 1) 37*( 1)
  7367.        39  ( 1) 43*( 1) 50 ( 1) 53 ( 1) 54 ( 1) 55 ( 1)
  7368.        63* ( 1) 65 ( 1) 67 ( 1) 68 ( 1) 74*( 1) 115 ( 1)
  7369.        142 ( 1) 168*( 1) 173*( 1)
  7370.   DCtlPtr 19 ( 1) 20 ( 1) 21 ( 1) 22 ( 1) 23 ( 1) 37 ( 1)
  7371.           43 ( 1) 63 ( 1) 74 ( 1) 168 ( 1) 173 ( 1)
  7372.   dCtlRefNum 39 ( 1) 54 ( 1)
  7373.   dCtlWindow 50 ( 1) 55=( 1) 67 ( 1) 68=( 1) 142 ( 1)
  7374.   etc.
  7375.  
  7376.   -V-
  7377.  
  7378.   VolName 79* ( 1) 100 ( 1) 135 ( 1)
  7379.  
  7380.   -W-
  7381.  
  7382.   what 149 ( 1)
  7383.   WindowKind 54= ( 1)
  7384.   windowpeek 54 ( 1)
  7385.   WindowPtr 48 ( 1) 67 ( 1) 151 ( 1) 153 ( 1)
  7386.   wRect 47* ( 1)
  7387.  
  7388.   *** End PasRef: 105 id's 249 references
  7389.  
  7390.   The numbers in parentheses following the line numbers are the include
  7391.   keys of the associated include files (shown in column 2 of the source
  7392.   listing). The include filenames are shown following the source listing.
  7393.   You can thus see what line number was in which include file. An asterisk
  7394.   (*) following a line number indicates a definition of the variable.
  7395.   An equal sign (=) indicates an assignment. A line number with nothing
  7396.   following it indicates a reference to the identifier.
  7397.  
  7398.   Limitations PasRef has these limitations:
  7399.  
  7400.     • PasRef does not process conditional compilation directives!
  7401.     Thus, given the "right" combination of $IFCs and $ELSECs, PasRef’s
  7402.     lexical (nesting) information can be thrown off. If this happens,
  7403.     or if you don’t want the lexical information, you can specify
  7404.     the -nolex option.
  7405.  
  7406.     • PasRef stores all its information on the Pascal heap. Up to
  7407.     5000 identifiers can be handled, but more identifiers will mean
  7408.     less cross-reference space. A message appears if PasRef runs
  7409.     out of heap space.
  7410.  
  7411.     • Note: Although PasRef never misses a reference, it can infrequently
  7412.     be fooled into thinking that a variable is defined when it actually
  7413.     isn’t. One case where this happens is in record structure variants.
  7414.     The record variant’s case tag is always flagged as a definition
  7415.     (even when there is no tag type) and the variant’s case label
  7416.     constants (if they are identifiers) are also sometimes incorrectly
  7417.     flagged, depending on the context. (This occurs only in the declaration
  7418.     parts of the program.)
  7419.  
  7420.     • While PasRef supports Pascal’s $$Shell facility in include
  7421.     files and USES declarations, the processing of MPW’s {PInterfaces}
  7422.     files is not fully supported because these files conditionally
  7423.     include files (remember, conditionals are not processed). For
  7424.     this reason, always use the -nu option to suppress processing
  7425.     of USES declarations.
  7426.  
  7427.     • The identifiers CYCLE and LEAVE are treated as reserved Pascal
  7428.     keywords by PasRef. These are treated as two loop control statements
  7429.     by Pascal unless explicitly declared.
  7430.  
  7431.   Availability PasRef is available as part of a separate Apple product,
  7432.   MPW 3.0 Pascal.
  7433.  
  7434.  
  7435.                              See also 
  7436.  
  7437.   Pascal command.
  7438.  
  7439.   MPW 3.0 Pascal Reference.
  7440.  
  7441. æKY Paste
  7442. æC          Paste -- replace selection with Clipboard contents
  7443.  
  7444. Paste [-c count] selection [window]
  7445.  -c count                # repeat the Paste count times
  7446.  
  7447. Status codes returned:
  7448.   0    At least one instance of the selection was found.
  7449.   1    Syntax error.
  7450.   2    Any other error.
  7451.  
  7452.                            Description
  7453.  
  7454.   Finds selection in the specified window and replaces its contents
  7455.   with the contents of the Clipboard. If no window is specified, the
  7456.   command operates on the target window (the second window from the
  7457.   front). It’s an error to specify a window that doesn’t exist.
  7458.  
  7459.   For a definition of selection, see "Selections" in Chapter 6 of the MPW 
  7460.   manual; a summary of the selection syntax is contained in Appendix B.
  7461.  
  7462.  
  7463.                              Examples
  7464.  
  7465.   Paste §
  7466.  
  7467.   Replaces the current selection with the contents of the Clipboard.
  7468.   This command is like the Paste item in the Edit menu, except that
  7469.   the action occurs in the target window.
  7470.  
  7471.   Paste /BEGIN/:/END/
  7472.  
  7473.   Selects everything from the next BEGIN to the following END and replaces
  7474.   the selection with the contents of the Clipboard.
  7475.  
  7476.  
  7477.                              See also 
  7478.  
  7479.   Copy, Cut, and Replace commands.
  7480.  
  7481.   "Edit Menu" in Chapter 3.
  7482.  
  7483.   "Selections" in Chapter 6.
  7484.  
  7485. æKY PerformReport
  7486. æC            PerformReport -- generate a performance report
  7487.  
  7488. PerformReport [option…]  > reportFile ≥ progress
  7489.  -a                      # list all procedures, in segment order
  7490.                          # (default: produce only partial list, sorted by %)
  7491.  -l linkDataFile         # read link map file (concatenated with ROM.list)
  7492.  -m measurementsFile     # read performance measurements file
  7493.                          # (default: "Perform.Out")
  7494.  -n NN                   # show the top NN procedures (default: 50)
  7495.  -p                      # write progress information to diagnostics
  7496.  
  7497. Status codes returned:
  7498.   0    No errors.
  7499.   1    Warning issued.
  7500.   2    Error encountered.
  7501.   3    Heap error;usually insufficient memory.
  7502.  
  7503.                            Description
  7504.  
  7505.   PerformReport reads a link map file and a performance data file and
  7506.   produces a report that relates the performance data to procedure
  7507.   names. The input files are both text files and are distinguished
  7508.   as separate options. For a full discussion of MPW’s performance measurement
  7509.   tools, see Chapter 14 of the MPW manual.
  7510.  
  7511.  
  7512.                              Examples
  7513.  
  7514.   Catenate "{MPW}"ROM.Maps:MacIIROM.map >> myMapFileName
  7515.  
  7516.   PerformReport -l myMapFileName > myReport
  7517.  
  7518.   Adds the ROM map file to the end of the link map file, myMapFileName.
  7519.   Reads the files myMapFileName and Perform.out and writes the output
  7520.   to myReport.
  7521.  
  7522.  
  7523.                              See also 
  7524.  
  7525.   Chapter 14, "Performance-Measurement Tools."
  7526.  
  7527.   MPW 3.0 Pascal Reference.
  7528.  
  7529.   MPW 3.0 C Reference .
  7530.  
  7531. æKY Position
  7532. æC              Position -- display current line position
  7533.  
  7534. Position [-l | -c] [window…]
  7535.  -l                      # only list the line number
  7536.  -c                      # only list the character offsets
  7537.  
  7538. Status codes returned:
  7539.   0    No errors.
  7540.   1    Syntax error.
  7541.   2    Any other error.
  7542.  
  7543.                            Description
  7544.  
  7545.   Position displays the position of the selection in each of the windows
  7546.   specified. If no window is specified, the position of the selection
  7547.   in the Target window is given. By default, the position is displayed
  7548.   as both the line number of the start of the selection and the character
  7549.   positions of the start and end of the selection. The -c option can
  7550.   be used to display only the character positions of the selection.
  7551.   Similarly, the -l option can be used to display only the line number.
  7552.  
  7553.  
  7554.                              Examples
  7555.  
  7556.   Position {Target} file2
  7557.  
  7558.   Displays the position of the selection in both the Target and file2
  7559.   in the following form:
  7560.  
  7561.   578 23129,23140
  7562.  
  7563.   211 8440,8440
  7564.  
  7565.  
  7566.                              See also 
  7567.  
  7568.   Find command.
  7569.  
  7570. æKY Print
  7571. æC                      Print -- print text files
  7572.  
  7573. Print [option…] file…  < file ≥ progress
  7574.  -b                   # print a border around the text
  7575.  -b2                  # alternate form of border
  7576.  -bm n[.n]            # bottom margin in inches (default 0)
  7577.  -c[opies] n          # print n copies
  7578.  -ff string           # treat "string" at beginning of line as a formfeed
  7579.  -f[ont] name         # print using specified font
  7580.  -from n              # begin printing with page n
  7581.  -h                   # print headers (time, file, page)
  7582.  -hf[ont] name        # print headers using specified font
  7583.  -hs[ize] n           # print headers using specified font size
  7584.  -l[ines] n           # print n lines per page
  7585.  -lm n[.n]            # left margin in inches (default .2778)
  7586.  -ls n[.n]            # line spacing (2 means double-space)
  7587.  -md                  # use modification date of file for time in header
  7588.  -n                   # print line numbers to left of text
  7589.  -nw [-]n             # width of line numbers, - indicates zero padding
  7590.  -p                   # write progress information to diagnostics
  7591.  -page n              # number pages beginning with n
  7592.  -ps filename         # include PostScript file as background for each page
  7593.  -q quality           # print quality (HIGH, STANDARD, DRAFT)
  7594.  -r                   # print pages in reverse order
  7595.  -rm n[.n]            # right margin in inches (default 0)
  7596.  -s[ize] n            # print using specified font size
  7597.  -t[abs] n            # consider tabs to be n spaces
  7598.  -title title         # include title in page headers
  7599.  -tm n[.n]            # top margin in inches (default 0)
  7600.  -to n                # stop printing after page n
  7601.  
  7602. Status codes returned:
  7603.   0    Successful completion.
  7604.   1    Parameter or option error.
  7605.   2    Execution error.
  7606.  
  7607.                            Description
  7608.  
  7609.   Prints text files on the currently selected printer. (Printers are
  7610.   selected with the Chooser desk accessory.) One or more files may
  7611.   be printed.
  7612.  
  7613.     • Note: Print does not substitute fonts unless the "Font Substitution"
  7614.     box is checked in the "LaserWriter Page Setup" dialog. To print
  7615.     in a font other than that indicated in the resource fork of the
  7616.     file where the MPW editor stores font information, use the -font
  7617.     option.
  7618.  
  7619.     • Important Print requires the printer drivers available on version
  7620.     1.0 (or later) of the Printer Installation disk.
  7621.  
  7622.  
  7623.                              Examples
  7624.  
  7625.   Print -h -size 8 -ls 0.85 Startup UserStartup
  7626.  
  7627.   Prints the files Startup and UserStartup with page headers, using
  7628.   Monaco 8 and compressing the line spacing.
  7629.  
  7630.   Print -b -hf helvetica -hs 12 -r print.p
  7631.  
  7632.   Prints the "print.p" source file with borders, with headers in Helvetica
  7633.   12, and with pages in reverse order.
  7634.  
  7635.  
  7636.                              See also 
  7637.  
  7638.   Print menu item in "File Menu," Chapter 3.
  7639.  
  7640. æKY PrintProff
  7641. æC   PrintProff -- analyze a .proff file and print the results
  7642.  
  7643. PrintProff TargetProgramName [-h | -f] [-c] [> outputFile]
  7644.     -h                      # hierarchical sort (default)
  7645.     -f                      # flat sort
  7646.     -c                      # for each procedure, list callees
  7647.  
  7648.  
  7649.                             Description
  7650.  
  7651. PrintProff is an MPW tool that analyzes the .proff data file created by running
  7652. a program built for profiling. PrintProff uses as input the target program’s 
  7653. .proff and .sym files.  By default, both of these files have the same name as the
  7654. target program with the appropriate extension added.  Also by default, PrintProff
  7655. looks for them in the Shell’s current directory.  Therefore, if the .proff and .sym
  7656. files are in the current directory, "TargetProgramName" is just the target's terminal
  7657. name.  Otherwise, it must be a full path name.  The .proff and .sym files in any case
  7658. must be in the same directory.  The output from PrintProff goes to standard output 
  7659. unless redirected to an output file.
  7660.  
  7661. The "-h" and "-f" options determine whether the information in the report is sorted
  7662. in the order, respectively, of descending "hierarchical" times or descending 
  7663. "flat" times (see below).
  7664.  
  7665. The "-c" option causes the redundant printing, for each procedure, of the profiling
  7666. data for each of its callees.
  7667.  
  7668. The report produced by PrintProff shows, for every monitored procedure (or 
  7669. function),the name of its caller and the statement number of the point of call, 
  7670. and, if the -c option is used, the names of its (monitored) callees.  Defining 
  7671. an "arc" to be an execution of a procedure from a specific call site, 
  7672. PrintProff reports:
  7673.  
  7674. 1.The number of times each arc was executed.
  7675.  
  7676. 2.The cumulative flat time for the arc.  The flat time is the amount of time spent
  7677. executing the procedure. It does not include time spent in callee procedures, 
  7678. provided these procedures were also monitored.  Nor does it include segment
  7679. loading or profiling overhead for the current procedure but it does include some
  7680. performance monitoring and procedure call overhead for the procedure (if any) 
  7681. called directly by the current one.  Note: If a callee was not built with the 
  7682. profiling options or directives, the profiling code will think that the callee 
  7683. was merely part of its caller.
  7684.  
  7685. 3. The cumulative hierarchical time for the arc. The hierarchical time is the
  7686. amount of time spent in this procedure, plus the time spent in any procedures 
  7687. called by this one (directly or indirectly) before it returns to its caller. 
  7688. It does not include segment loading or profiling overhead for the current 
  7689. procedure.  However, the hierarchical time does include this overhead for 
  7690. called procedures.
  7691.  
  7692. 4. For calls across segments, the caller and the callee segment name and number.
  7693.  
  7694.  
  7695.  
  7696.                                 Examples
  7697.  
  7698. 2____________________________________________________________________________________
  7699. SkelMain
  7700.     Total Time:              9,768,889 H       2,135,743 F/1   (95.236%H/20.821%F)
  7701.  
  7702.     Called by Procs:
  7703.        1  main.(51)
  7704.                            9,768,889 H      2,135,743 F/1   1/Main -> 3/TransSkel
  7705.     Calls Procs:
  7706.           3  Background
  7707.                            3,614,659 H      1,786,999 F/233 3/TransSkel -> 1/Main
  7708.           4  DoEvent
  7709.                            3,531,485 H      2,381,569 F/39 
  7710.           9  LogEvent
  7711.                              448,654 H          2,432 F/39     3/TransSkel -> 1/Main
  7712.          32  DoIdle
  7713.                               38,347 H         20,059 F/806
  7714.  
  7715.   3____________________________________________________________________________________
  7716. Background
  7717.     Total Time:              3,614,659 H          1,786,999 F/233 (35.239%H/17.421%F)
  7718.  
  7719.     Called by Procs:
  7720.            2  SkelMain.(7)
  7721.                             3,614,659 H     1,786,999 F/233 3/TransSkel -> 1/Main
  7722.     Calls Procs:
  7723.            5  fugitIdle
  7724.                             1,757,392 H     1,757,392 F/233
  7725.           26  CheckFront
  7726.                                70,267 H        43,840 F/233
  7727.  
  7728.  
  7729.  
  7730.  4____________________________________________________________________________________
  7731. DoEvent
  7732.     Total Time:            3,531,485 H       2,381,569 F/39   (34.428%H/23.218%F)
  7733.  
  7734.      Called by Procs:
  7735.           2  SkelMain.(15)
  7736.                            3,531,485 H     2,381,569 F/39 
  7737.      Calls Procs:
  7738.           6  DoMenuCommand
  7739.                              812,762 H        11,903 F/3  
  7740.          14  DoUpdate
  7741.                              183,092 H         3,511 F/11 
  7742.          21  DoMouse
  7743.                              125,578 H           292 F/5  
  7744.          38  DoActivate
  7745.                               25,193 H           547 F/11 
  7746.          55  DoDialog
  7747.                                1,211 H         1,211 F/39 
  7748.          54  GetWHandler
  7749.                                  840 H           639 F/13 
  7750.          54  GetWHandler
  7751.                                  621 H           465 F/11 
  7752.          54  GetWHandler
  7753.                                  616 H           464 F/11 
  7754. Notes on the example:
  7755. •   Entries like 3/TransSkel -> 1/Main indicate inter-segment calls and show segment 
  7756.     number and segment name for caller and callee.
  7757.  
  7758. •   In the entry "3,614,659 H       1,786,999 F/233", the integer following the "/" 
  7759.     is the number of executions of the arc.  H indicates hierarchical time and F 
  7760.     indicates flat time.  These times are the sum of the times for all executions of 
  7761.     the arc--in this case 233 executions.  Units are microseconds and represent real 
  7762.     time.
  7763.  
  7764. •   In the entry "2  SkelMain.(7)", the integer in parenthesis is the statement number
  7765.     at which the call occurs.
  7766.  
  7767. •    The information provided about each monitored procedure contains a "Called by 
  7768.      procs:" and an optional "Calls procs:" section.  In these sections, the integer
  7769.      preceding each procedure name listed is an index back to that procedure’s ranking
  7770.      in the major sort of monitored procedures.
  7771.  
  7772. •    The information provided about each monitored procedure contains an optional
  7773.     "Calls procs:" section.  The time given for a procedure listed in this section is 
  7774.      the total time for the arc originating in the monitored procedure and ending in 
  7775.      the called procedure.  This value is not the total time for the called procedure 
  7776.      unless the monitored procedure is its only caller.   If the same procedure is
  7777.      listed multiple times in the "Calls procs:" section, this shows that it was 
  7778.      called from that number of different locations in the monitored procedure.
  7779.  
  7780.                             See also
  7781.  
  7782. Profiling
  7783.  
  7784. æKY ProcNames
  7785. æC        ProcNames -- display Pascal procedure and function names
  7786.  
  7787. ProcNames [option…] [file…]  < file ≥ progress
  7788.     -b                      # display line info for procedure body
  7789.     -c                      # process includes and units only once
  7790.     -cond                   # process $SETC and $IFC, $ELSEC, $ENDC conditionals
  7791.     -d                      # reset total line count to 1 on each new file
  7792.     -d name=TRUE|FALSE      # set $SETC variable name to TRUE or FALSE
  7793.     -e                      # suppress page eject between each procedure listing
  7794.     -f                      # PasMat format compatibility mode
  7795.     -i pathname,…           # search for includes or USES in directory,…
  7796.     -l n                    # process only to max nesting level n
  7797.     -m                      # generate MPW Mark commands for procedure and function declarations
  7798.     -mc68020                # source contains {$IFC OPTION(MC68020)} directives
  7799.     -mc68881                # source contains {$IFC OPTION(MC68881)} directives
  7800.     -n                      # suppress line number and level information
  7801.     -o                      # source file is an Object Pascal program
  7802.     -p                      # write progress information to diagnostics
  7803.     -u                      # process USES declarations
  7804.  
  7805.   Status codes returned:
  7806.      0    Normal termination.
  7807.      1    Parameter or option error.
  7808.  
  7809.                            Description
  7810.  
  7811.   ProcNames is a Pascal utility that accepts a Pascal program or unit
  7812.   as input and produces a listing of all its procedure and function
  7813.   names. The names are shown indented as a function of their nesting
  7814.   level. The nesting level and line-number information is also displayed.
  7815.  
  7816.   ProcNames can be used in conjunction with the Pascal "pretty-printer"
  7817.   PasMat when that utility is used to format separate include files.
  7818.   For that case, PasMat requires that the initial indenting level be
  7819.   specified. This level is exactly the information provided by ProcNames.
  7820.  
  7821.   The line-number information displayed by ProcNames exactly matches
  7822.   that produced by the Pascal cross-reference utility PasRef (with
  7823.   or without USES declarations being processed), so ProcNames can be
  7824.   used in conjunction with the listing produced by PasRef to show just
  7825.   the line numbers of every procedure or function header.
  7826.  
  7827.   Another possible use for the ProcNames output is to use the line-number
  7828.   and file information to find procedures and functions quickly with
  7829.   Shell editing commands.
  7830.  
  7831.  
  7832.                              Examples
  7833.  
  7834.   procnames Memory.p >names
  7835.  
  7836.   Lists all the procedures and functions for the Pascal program Memory.p
  7837.   and writes the output to the file "names". The listing below is the
  7838.   output generated in the "names" file.
  7839.  
  7840.   Procedure/Function names for Memory.p
  7841.  
  7842.    11  11 0 Memory[Main] Memory.p
  7843.    37  37 1 RsrcID
  7844.    43  43 1 DRVROpen
  7845.    63  63 1 DRVRCloseaa
  7846.    74  74 1 DRVRControla
  7847.    76  76 2   DrawWindow
  7848.    83  83 3     PrintNum
  7849.    93  93 3     GetVolStuff
  7850.   108 108 3     PrtRsrcStr
  7851.   168 168 1 DRVRPrime
  7852.   173 173 1 DRVRStatus
  7853.  
  7854.   *** End ProcNames: 11 Procedures and Functions
  7855.  
  7856.   The first two columns on each line are line-number information. The
  7857.   third column is the level number. The first column shows the line
  7858.   number of a routine within the total source. The second column shows
  7859.   the line number within an include file (include files are always
  7860.   processed). As each include file changes, the name of the file from
  7861.   which input is being processed is shown along with the routine name
  7862.   on the first line after the change in source. Segment names (from
  7863.   Pascal compiler $S directives) are similarly processed. These are
  7864.   shown enclosed in square brackets (the blank segment name is shown
  7865.   as "[Main]").
  7866.  
  7867.   Limitations Only syntactically correct programs are accepted by ProcNames.
  7868.   Conditional compilation compiler directives are not processed.
  7869.  
  7870.   Although ProcNames supports $$Shell facility in includes and USES,
  7871.   the processing of MPW’s {PInterfaces} files is not fully supported
  7872.   because these files conditionally include files. Therefore, do not
  7873.   use the -u option.
  7874.  
  7875. æKY Project
  7876. æC             Project -- set or write the current project
  7877.  
  7878. Project [-q | projectName]   > project
  7879.  -q                      # don't quote projects with special characters
  7880.  
  7881. Status codes returned:
  7882.   0    No errors.
  7883.   1    Syntax error.
  7884.   2    Error in processing.
  7885.  
  7886.                            Description
  7887.  
  7888.   Set the current project to projectname or list the current project
  7889.   if projectname is omitted. Projectname must be a mounted project.
  7890.   Refer to the MountProject command for information on how to mount
  7891.   projects.
  7892.  
  7893.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  7894.   symbols used in Projector commands.
  7895.  
  7896. æKY ProjectInfo
  7897. æC          ProjectInfo -- display information about a Project
  7898.  
  7899. ProjectInfo [-project project] [-comments] [-latest] [-f] [-r] [-s] [-only 
  7900.             | -m] [-af author | -a author] [-df dates | -d dates] 
  7901.             [-cf pattern | -c pattern] [-t pattern] [-n name] 
  7902.             [-newer | -update] [file…]
  7903.  -a author         # only list revisions created by author
  7904.  -af author        # only list files created by author
  7905.  -c pattern        # only list revisions whose comment contains pattern
  7906.  -cf pattern       # only list files whose comment contains pattern
  7907.  -comments         # list comments along with the rest of the information
  7908.  -d dates          # only list revisions whose create date is within dates
  7909.  -df dates         # only list files whose mod date is within dates
  7910.  -f                # list file information
  7911.  -log              # print project log
  7912.  -m                # only list files/revisions that are checked out
  7913.  -newer            # info on files that would be checked out using this option
  7914.  -only             # only list project information
  7915.  -project project  # name of project to get information on
  7916.  -r                # recursively list subprojects
  7917.  -latest           # only list info on the latest revision on the main trunk
  7918.  -s                # short listing, names and revision names only
  7919.  -t pattern        # only list revisions whose task contains pattern
  7920.  -n name           # only list revisions that have name
  7921.  -update           # info on files that would be checked out using this option
  7922.  
  7923.  Note: pattern is either a literal string or /regular expression/.
  7924.  
  7925.  Note: "dates" may take the following forms:
  7926.      date                # on date
  7927.      <date               # before but not including date
  7928.      ≤date               # before and including date
  7929.      >date               # after and not including date
  7930.      ≥date               # after and including date
  7931.      date-date           # between and including dates
  7932.      
  7933.  Note:  A date is mm/dd/yy [[hh:mm[:ss]] [AM|PM]]
  7934.  
  7935.  Note: "name" may take the following forms:
  7936.      name                # in name
  7937.      <name               # before name
  7938.      ≤name               # before and including name
  7939.      >name               # after name
  7940.      ≥name               # after and including name
  7941.  
  7942. Status codes returned:
  7943.   0    No errors.
  7944.   1    Syntax error.
  7945.   2    Error in processing.
  7946.   3    System error.
  7947.  
  7948.                            Description
  7949.  
  7950.   By default (with no options specified), ProjectInfo lists information
  7951.   about each revision in every revision tree (file) in the current
  7952.   project. This behavior can be changed using the various options.
  7953.   For example, using the -latest option will display only information
  7954.   about the latest revision on the main trunk of each revision tree.
  7955.   Using the -f option will display information about the revision tree,
  7956.   rather than the particular revisions within that tree. Various other
  7957.   options exist that filter the output such that only the information
  7958.   (typically revisions) that passes through the filter is listed.
  7959.  
  7960.   If object is a project pathname such as Enterprise∫Phaser∫file.c
  7961.   or Enterprise∫Phaser, Projector lists information about every revision
  7962.   of file.c in the Phaser project, or information about every revision
  7963.   tree in the project Enterprise∫Phaser, respectively.
  7964.  
  7965.   If object is a leafname such as file.c, Projector looks in the current
  7966.   project for a revision tree with that name. If found, information
  7967.   about every revision in that revision tree (file.c) is listed. If
  7968.   the file is not a member of the current project, Projector looks
  7969.   for the file in the current directory. If the file exists and is
  7970.   part of a project, then the current state of that file is listed.
  7971.   Projector can determine whether a file belongs to a project because
  7972.   that information is maintained in the resource fork of all checked-out
  7973.   files.
  7974.  
  7975.   Finally, if object is a valid partial or full HFS pathname of a file,
  7976.   and the file is part of a project, then the current state of that
  7977.   file is listed.
  7978.  
  7979.   To list the contents of a specific revision of a file, append a comma
  7980.   followed by the revision number to the filename specified. For example,
  7981.   revision 22 of file.c is specified as file.c,22.
  7982.  
  7983.   You can use the -af, -a, -df, -d, -n, -cf, -c, and -t options to
  7984.   filter (constrain) the information listed to specific authors, dates,
  7985.   names, specific comments, or tasks.
  7986.  
  7987.   Use the -log option to display a log of all changes to the project.
  7988.   These commands are logged: NameRevisions, DeleteRevisions, and DeleteNames.
  7989.  
  7990.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  7991.   symbols used in Projector commands.
  7992.  
  7993.  
  7994.                              Examples
  7995.  
  7996.   In the example below, the current project has three files. The -latest
  7997.   option is used so that only information about the latest revision
  7998.   on the main trunk is listed. The presence of the plus sign (+) indicates
  7999.   that Bob currently has revision 22 of file.c checked out for modification,
  8000.   and that Peter has revision 33 of hdr.c checked out for modification.
  8001.   The date field of these two files reflects the date and time they
  8002.   were checked out. Because no plus sign appears on the line for file.h,
  8003.   it can be checked out for modification. The latest revision of file.h
  8004.   is 17, and the author of the revision is Bob.
  8005.  
  8006.   ProjectInfo -latest
  8007.  
  8008.   Sample∫
  8009.   file.c,22+
  8010.     Owner: Bob
  8011.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  8012.     Task: Fixing bug #223
  8013.  
  8014.   file.h,17
  8015.     Author: Bob
  8016.     Checked in: Mon, Apr 4, 1988, 10:10 AM
  8017.     Task:
  8018.  
  8019.   hdr.c,33+
  8020.     Owner: Peter
  8021.     Checked out: Tue, Apr 12, 1988, 5:58 PM
  8022.     Task: Fixing bug #333
  8023.  
  8024.   Using the -only option causes ProjectInfo to list only information
  8025.   about the project itself.
  8026.  
  8027.   ProjectInfo -only
  8028.  
  8029.   Sample∫
  8030.     Author: Bob
  8031.     Create date: Mon, Apr 4, 1988 8:20 AM
  8032.     Mod date: Thu, Apr 14, 1988, 6:00 PM
  8033.  
  8034.   Use the -f option to list filenames. Note that revision numbers are
  8035.   absent and that the file’s author and last-mod-date are listed. In
  8036.   the example below, file.c and hdr.c are currently checked out.
  8037.  
  8038.   ProjectInfo -f
  8039.  
  8040.   Sample∫
  8041.   file.c
  8042.     Author: Bob
  8043.     Create date: Mon, Apr 4, 1988, 10:00 AM
  8044.     Mod date: Tue, Apr 5, 1988, 2:15 PM
  8045.     Free: No
  8046.  
  8047.   file.h
  8048.     Author: Bob
  8049.     Create date: Mon, Apr 4, 1988, 10:00 AM
  8050.     Mod date: Mon, Apr 4, 1988, 10:00 AM
  8051.     Free: Yes
  8052.  
  8053.   hdr.c
  8054.     Author: Peter
  8055.     Create date: Mon, Apr 4, 1988, 3:30 PM
  8056.     Mod date: Mon, Apr 4, 1988, 6:00 PM
  8057.     Free: No
  8058.  
  8059.   Use the -f and -s options together to output the list of files in
  8060.   the project:
  8061.  
  8062.   ProjectInfo -f -s
  8063.  
  8064.   Sample∫
  8065.   file.c
  8066.   file.h
  8067.   hdr.c
  8068.  
  8069.   The following command will display the entire revision history of
  8070.   file.c. Note that the comment option has been included here as well.
  8071.  
  8072.   ProjectInfo -comments file.c
  8073.  
  8074.   file.c,2+
  8075.     Owner: Bob
  8076.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  8077.     Task: Fixing bug #223
  8078.     Comment: COMMENT…
  8079.  
  8080.   file.c,2
  8081.     Author: Bob
  8082.     Checked in: Thu, Apr 7, 1988, 1:10 PM
  8083.     Task: Fixing bug #222
  8084.     Comment: COMMENT…
  8085.  
  8086.   file.c,1
  8087.     Author: Bob
  8088.     Checked in: Mon, Apr 4, 1988, 9:25 PM
  8089.     Task: Updating procedure comments
  8090.     Comment: COMMENT…
  8091.  
  8092.   Information about HFS files may be displayed by specifying a partial
  8093.   or full HFS pathname. This displays the information in the 'ckid'
  8094.   resource of the file.
  8095.  
  8096.   ProjectInfo :file.c
  8097.  
  8098.   :file.c,22*
  8099.     Owner: Bob
  8100.     Project: Sample∫
  8101.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  8102.     Task: Fixing bug #223
  8103.  
  8104.   The asterisk (*) following the name indicates that the file is a
  8105.   modified read-only file.
  8106.  
  8107.   In the example below, only revisions created by Bob and created on
  8108.   or after April 4, 1988, are displayed.
  8109.  
  8110.   ProjectInfo -a Bob -d
  8111.  
  8112.   Sample∫
  8113.   file.c,22+
  8114.     Owner: Bob
  8115.     Checked out: Fri, Apr 8, 1988, 3:45 PM
  8116.     Task: Fixing bug #223
  8117.  
  8118.   file.c,22
  8119.     Author: Bob
  8120.     Checked in: Thu, Apr 7, 1988, 1:10 PM
  8121.     Task: Fixing bug #222
  8122.  
  8123.   file.c,21
  8124.     Author: Bob
  8125.     Checked in: Mon, Apr 4, 1988, 9:25 PM
  8126.     Task: Updating procedure comments
  8127.  
  8128.   file.h,17
  8129.     Author: Bob
  8130.     Checked in: Mon, Apr 4, 1988, 10:10 AM
  8131.     Task:
  8132.  
  8133.   In the example below, only revisions that have a task dealing with
  8134.   Bug #222 are listed.
  8135.  
  8136.   ProjectInfo -t /bug≈222/
  8137.  
  8138.   Sample∫
  8139.   file.c,22
  8140.     Author: Bob
  8141.     Checked in: Thu, Apr 7, 1988, 1:10 PM
  8142.     Task: Fixing bug #222
  8143.  
  8144.   hdr.c,31
  8145.     Author: Peter
  8146.     Checked in: Fri, Apr 1, 1988, 3:50 PM
  8147.     Task: Bug222 - Adding check procedure
  8148.  
  8149.   The final example demonstrates the -log option.
  8150.  
  8151.   ProjectInfo -log
  8152.  
  8153.   TheShell∫Projector
  8154.     7/5/88 4:07 PM
  8155.       Peter J. Potrebic
  8156.       DeleteNames Work
  8157.     7/2/88 1:37 PM
  8158.       Peter J. Potrebic
  8159.       NameRevisions Work bitmaps.a,2 ckid.c,3a2
  8160.  
  8161.   The log shows that Peter created a public name on July 2 and then
  8162.   deleted it on July 5.
  8163.  
  8164.  
  8165.                              See also 
  8166.  
  8167.   MountProject and UnmountProject.
  8168.  
  8169. æKY Quit
  8170. æC                          Quit -- quit MPW
  8171.  
  8172. Quit [-y | -n | -c]
  8173.  -y                  # save all modified windows (avoids dialog)
  8174.  -n                  # do not save any modified windows (avoids dialog)
  8175.  -c                  # cancel if a window needs to be saved (avoids dialog)
  8176.  
  8177. Status codes returned:
  8178.   1    Syntax error.
  8179.   2    Command aborted.
  8180.        Note: Quit cannot return a status of 0, because if there are no errors 
  8181.        the command never returns.
  8182.  
  8183.                            Description
  8184.  
  8185.   This command is equivalent to the menu command Quit. Quit executes
  8186.   the standard quit procedures, asking confirmation to save modified
  8187.   files, close all windows, and so on.
  8188.  
  8189.  
  8190.                              Examples
  8191.  
  8192.   Quit -y
  8193.  
  8194.   Quits MPW answering "Yes" to any dialogs such as those prompting
  8195.   to save files.
  8196.  
  8197.   Quit -c
  8198.  
  8199.   Quits MPW, unless any confirmation dialogs occur and dialog boxes
  8200.   are displayed.
  8201.  
  8202.  
  8203.                              See also 
  8204.  
  8205.   Shutdown command.
  8206.  
  8207. æKY Quote
  8208. æC             Quote -- echo parameters, quoting if needed
  8209.  
  8210. Quote [-n] [parameter…]   > parameters
  8211.  -n                      # don't write return following the parameters
  8212.  
  8213. Status codes returned:  
  8214.  0  no errors always returned.
  8215.  
  8216.                            Description
  8217.  
  8218.   Quote writes its parameters, separated by spaces and terminated by
  8219.   a return, to standard output. Parameters containing characters that
  8220.   have special meaning to the Shell’s command interpreter are quoted
  8221.   with single quotation marks. If no parameters are specified, only
  8222.   a return is written.
  8223.  
  8224.   Quote is identical to Echo except that Quote quotes parameters that
  8225.   contain special characters. Quote is especially useful when using
  8226.   Shell commands to write a script.
  8227.  
  8228.   The following special characters are quoted:
  8229.  
  8230.   Space Tab Return Null
  8231.  
  8232.   # ; & | ( ) ∂ ' " / \ { } ` ? ≈ [ ] + * « » ® < > ≥ …
  8233.  
  8234.  
  8235.                              Examples
  8236.  
  8237.   Echo ≈.a
  8238.  
  8239.   Quote ≈.a
  8240.  
  8241.   Sample.a Count.a My Program.a
  8242.  
  8243.   Sample.a Count.a 'My Program.a'
  8244.  
  8245.   Echo and Quote behave slightly differently for parameters that contain
  8246.   special characters. The first line above was produced by Echo; the
  8247.   second by Quote.
  8248.  
  8249.   Quote Notice what happens to single quotes: "--'--"
  8250.  
  8251.   Notice what happens to single quotes: '--'''--'
  8252.  
  8253.   Because single quotes can’t appear within single quotes, they are
  8254.   replaced with
  8255.  
  8256.   '' ' which closes the original single quote, adds a literal quote,
  8257.   and reopens the single quotes.
  8258.  
  8259.   For file In ≈.a
  8260.     Quote Print "{file}"
  8261.   End
  8262.   Print Sample.a
  8263.   Print Count.a
  8264.   Print 'My Program.a'
  8265.  
  8266.   The For loop shown above writes a Print command for each file that
  8267.   matches the pattern ≈.a. These commands can then be selected and
  8268.   executed. Notice the quotation marks in the last Print command.
  8269.  
  8270.  
  8271.                              See also 
  8272.  
  8273.   Echo and Parameters commands.
  8274.  
  8275. æKY Rename
  8276. æC               Rename -- rename files and directories
  8277.  
  8278. Rename [-y | -n | -c] oldName newName
  8279.  -y                      # overwrite existing file (avoids dialog)
  8280.  -n                      # don't overwrite existing file (avoids dialog)
  8281.  -c                      # cancel if conflict occurs (avoids dialog)
  8282.  
  8283. Status codes returned:
  8284.   0    Successful rename.
  8285.   1    Syntax error.
  8286.   2    Name does not exist.
  8287.   3    An error occurred.
  8288.   4    Cancel was selected or implied by the -c option.
  8289.  
  8290.                            Description
  8291.  
  8292.   The file, folder or disk specified by name is renamed newName. A
  8293.   dialog box requests a confirmation if the rename would overwrite
  8294.   an existing file or folder. The -y, -n, or -c options can be used
  8295.   to avoid this interaction.
  8296.  
  8297.     • Note: You can’t use the Rename command to change the directory
  8298.     a file is in. To do this, use the Move command.
  8299.  
  8300.     • Note also: Wildcard renames in the following form will not
  8301.     work:
  8302.  
  8303.   Rename ≈.text ≈.p
  8304.  
  8305.   This is because the Shell expands the filename patterns "≈.text"
  8306.   and "≈.p" before invoking the Rename command. In order to gain the
  8307.   desired effect, you would need to execute a command such as the one
  8308.   shown in the fifth example below.
  8309.  
  8310.  
  8311.                              Examples
  8312.  
  8313.   Rename File1 File2
  8314.  
  8315.   Changes the name of File1 to File2.
  8316.  
  8317.   Rename HD:Programs:Prog.c Prog.Backup.c
  8318.  
  8319.   Changes the name of Prog.c in the directory HD:Programs to Prog.Backup.c
  8320.   in the same directory.
  8321.  
  8322.   Rename Untitled: Backup:
  8323.  
  8324.   Changes the name of the disk Untitled to Backup.
  8325.  
  8326.   Rename -c File1 File2
  8327.  
  8328.   Changes the name of File1 to that of File2; if a conflict occurs,
  8329.   it cancels the operation and returns a status of 4.
  8330.  
  8331.   To perform a wildcard rename, you could execute the following set
  8332.   of commands:
  8333.  
  8334.   For Name In ≈.text
  8335.     ( Evaluate {Name} =~ /(≈)®1.text/ ) > Dev:Null
  8336.     Rename {Name} {®1}.p
  8337.   End
  8338.  
  8339.   The Evaluate command is executed only for its side effect of permitting
  8340.   regular expression processing. (The expression operator =~ indicates
  8341.   that the right side of the expression is a regular expression.) Thus,
  8342.   you can use the regular expression capture mechanism, (regularExpr)®n.
  8343.   Evaluate’s output is tossed in the bit bucket (Dev:Null).
  8344.  
  8345.  
  8346.                              See also 
  8347.  
  8348.   Move command.
  8349.  
  8350. æKY Replace
  8351. æC                   Replace -- replace the selection
  8352.  
  8353. Replace [-c count] selection replacement [window]
  8354.  -c count                # repeat the replace count times
  8355.  
  8356. Status codes returned:
  8357.   0    At least one instance of the selection was found.
  8358.   1    Syntax error.
  8359.   2    Any other error.
  8360.  
  8361.                            Description
  8362.  
  8363.   Replace finds selection in the specified window and replaces it with
  8364.   replacement. If no window is specified, the command operates on the
  8365.   target window (the second window from the front). It’s an error to
  8366.   specify a window that doesn’t exist. If a count is specified, the
  8367.   Replace command is repeated count times.
  8368.  
  8369.   For a definition of selection, see "Selections" in Chapter 6 of the MPW
  8370.   manual. A summary of the selection syntax is contained in Appendix B.
  8371.  
  8372.   You can include references to parts of the selection in the replacement
  8373.   by using the ® operator. The expression ®n, where n is a digit, is
  8374.   replaced with the string of characters that matches the regular expression
  8375.   tagged by ®n in the selection. (See "Tagging Regular Expressions
  8376.   With the ® Operator" in Chapter 6.)
  8377.  
  8378.   The selection is a selection expression while replacement is a string
  8379.   (that could contain the ® operator). If replacement contains spaces
  8380.   or special characters, enclose it in quotation marks.
  8381.  
  8382.   All searches are by default not case sensitive. To specify case-sensitive
  8383.   matching, set the {CaseSensitive} variable before executing the command.
  8384.  
  8385.  
  8386.                              Examples
  8387.  
  8388.   Replace -c ∞ /myVar/ 'myVariable' Prog.p
  8389.  
  8390.   Replaces every subsequent instance of the selection with the string
  8391.   in single quotation marks.
  8392.  
  8393.   Replace -c 5 /•[ ]+/ ''
  8394.  
  8395.   Strips off all the spaces and tabs at the front of the next five
  8396.   lines in the file (and replaces them with the null string). This
  8397.   action takes place in the target window.
  8398.  
  8399.   Set HexNum "[0-9A-F]+"
  8400.   Set Spaces "[ ]+"
  8401.   Replace -c ∞ /({HexNum})®1{Spaces}({HexNum})®2/ ®1 ®2
  8402.  
  8403.   Defines two variables for use in the subsequent Replace command,
  8404.   and converts a file that contains two columns of hex digits (such
  8405.   as the icon list from ResEdit) into a single column of hex digits.
  8406.  
  8407.  
  8408.                              See also 
  8409.  
  8410.   Find and Clear commands.
  8411.  
  8412.   Chapter 6.
  8413.  
  8414.   Appendix B.
  8415.  
  8416. æKY Request
  8417. æC              Request -- request text from a dialog box
  8418.  
  8419. Request [-q] [-d default] [message…] < file 
  8420.  -q                      # don't set status if user selects cancel
  8421.  -d default              # set default response
  8422.  
  8423. Status codes returned:
  8424.   0    The OK button was selected.
  8425.   1    Syntax errors.
  8426.   4    The Cancel button was selected.
  8427.  
  8428.                            Description
  8429.  
  8430.   Request displays an editable text dialog box with OK and Cancel buttons
  8431.   and the prompt message. If you select the OK button, any text you
  8432.   type into the dialog box is written to standard output. The -d option
  8433.   lets you set a default response to the request.
  8434.  
  8435.  
  8436.                              Examples
  8437.  
  8438.   Set Exit 0
  8439.   Set FileName "`Request 'File to compile' -d "{Active}"`"
  8440.   If {FileName} ≠ ""
  8441.     Pascal "{FileName}" ≥≥ "{WorkSheet}"
  8442.   End
  8443.   Set Exit 1
  8444.  
  8445.   Displays a dialog box that lets the user enter the name of a file
  8446.   to be compiled. Sets the default to be the name of the active window,
  8447.   as follows:
  8448.  
  8449. æKY ResEqual
  8450. æC           ResEqual -- compares the resources in two files
  8451.  
  8452. ResEqual [-p] File1 File2
  8453.  -p                      # write progress information to diagnostics
  8454.  
  8455. Status codes returned:
  8456.   0    Resources match.
  8457.   1    Parameter or option error.
  8458.   2    Files don’t match.
  8459.  
  8460.                            Description
  8461.  
  8462.   ResEqual compares the resources in two files and writes their differences
  8463.   to standard output.
  8464.  
  8465.   ResEqual checks that each file contains resources of the same type
  8466.   and identifier as the other file; that the size of the resources
  8467.   with the same type and identifier are the same; and that their contents
  8468.   are the same.
  8469.  
  8470.  
  8471.                              Examples
  8472.  
  8473.   Resequal Sample Sample.rsrc
  8474.  
  8475.   Compares the resources in Sample and Sample.rsrc, writing the results
  8476.   to standard output.
  8477.  
  8478.   Limitations When the contents of resources are compared and a mismatch
  8479.   is found, the mismatch and the subsequent 15 bytes are written. ResEqual
  8480.   then continues the comparison, starting with the byte following the
  8481.   last displayed.
  8482.  
  8483.   If more than ten differences are detected in the same resource, the
  8484.   rest of the resource is skipped and processing continues with the
  8485.   next resource.
  8486.  
  8487.  
  8488.                              See also 
  8489.  
  8490.   Equal command. (The -r option of Equal compares the resource forks
  8491.   of files on a byte-by-byte basis, including the resource map.)
  8492.  
  8493.  
  8494. æKY Revert
  8495. æC           Revert -- revert window to previous saved state
  8496.  
  8497. Revert [-y] [window…]
  8498.  -y                      # revert to old version (without dialog)
  8499.  
  8500. Status codes returned:
  8501.   0    No errors.
  8502.   1    Parameter or option error.
  8503.   2    The specified window does not exist.
  8504.   3    A system error occurred.
  8505.   4    The Cancel button was selected.
  8506.  
  8507.                            Description
  8508.  
  8509.   Reverts the specified windows to their previously saved states. If
  8510.   no window is specified, Revert works on the target window. Revert
  8511.   displays a confirmation dialog box, but you can avoid this dialog
  8512.   box by using the -y option to revert unconditionally to the last
  8513.   saved version of the document.
  8514.  
  8515.  
  8516.                              Examples
  8517.  
  8518.   Revert
  8519.  
  8520.   Displays a confirmation dialog box for reverting the target window
  8521.   to its last saved state.
  8522.  
  8523.   Revert -y {Worksheet}
  8524.  
  8525.   Reverts unconditionally to last saved worksheet.
  8526.  
  8527.  
  8528.                              See also 
  8529.  
  8530.   Close and Save commands.
  8531.  
  8532. æKY Rez
  8533. æC                       Rez -- resource compiler
  8534.  
  8535. Rez [option…] [file…]  < file ≥ progress
  8536.     -a[ppend]               # merge resource into output resource file
  8537.     -align word | longword  # align resource to word or longword boundries
  8538.     -c[reator] creator      # set output file creator
  8539.     -d[efine] name[=value]  # equivalent to: #define macro [value]
  8540.     -i[nclude] pathname     # path to search when looking for  #include files
  8541.     -m[odification]         # don't change the output file's modification date
  8542.     -o file                 # write output to file (default Rez.Out)
  8543.     -ov                     # ok to overwrite protected resources when appending
  8544.     -p                      # write progress information to diagnostics
  8545.     -rd                     # suppress warnings for redeclared types
  8546.     -ro                     # set the mapReadOnly flag in output
  8547.     -s[earch] pathname      # path to search when looking for INCLUDE resources
  8548.     -t[ype] type            # set output file type
  8549.     -u[ndef] name           # equivalent to: #undef name
  8550.  
  8551. Status codes returned:
  8552.   0    No errors.
  8553.   1    Error in parameters.
  8554.   2    Syntax error in file.
  8555.   3    I/O or program error.
  8556.  
  8557.                            Description
  8558.  
  8559.   Rez compiles the resource fork of a file according to a textual description.
  8560.   The resource description file is a text file that has the same format
  8561.   as the output produced by DeRez, the resource decompiler. The data
  8562.   used to build the resource file can come directly from the resource
  8563.   description file(s) as well as from other text files (via #include
  8564.   and read directives in the resource description file) and from other
  8565.   resource files (via the include directive).
  8566.  
  8567.   Rez includes macro processing, full expression evaluation, and built-in
  8568.   functions and system variables. For information about Rez and the
  8569.   format of a resource description file, see Chapter 11 of the MPW manual. 
  8570.   For a summary of the format of a resource description file, see Appendix D.
  8571.  
  8572.  
  8573.                              Examples
  8574.  
  8575.   Rez Types.r Sample.r -o Sample
  8576.  
  8577.   Generates a resource fork for the file Sample, based on the descriptions
  8578.   in Types.r and Sample.r.
  8579.  
  8580.  
  8581.                              See also 
  8582.  
  8583.   DeRez and RezDet commands.
  8584.  
  8585.   Chapter 11 and Appendix D.
  8586.  
  8587.   Standard resource type declarations in the directory {RIncludes}:
  8588.  
  8589.     • Types.r
  8590.  
  8591.     • SysTypes.r
  8592.  
  8593.     • MPWTypes.r
  8594.  
  8595.     • Pict.r
  8596.  
  8597. æKY RezDet
  8598. æC            RezDet -- detect inconsistencies in resources
  8599.  
  8600. RezDet [option…] file…   > dump
  8601.  -b[ig]                  # read resources one at a time, not all at once
  8602.  -d[ump]                 # write -show information, plus headers, lists, etc.
  8603.  -l[ist]                 # write list of resources with minimum information
  8604.  -q[uiet]                # don't write any output, just set {Status}
  8605.  -r[awdump]              # write -dump information plus contents
  8606.  -s[how]                 # write information about each resource
  8607.  
  8608.  Note: Use at most one of -quiet, -list, -show, -dump, and -rawdump.
  8609.  
  8610. Status codes returned:
  8611.   0    No errors detected.
  8612.   1    Invalid options or no files specified.
  8613.   2    Resource format error detected.
  8614.   3    Fatal error—an I/O or program error was detected.
  8615.  
  8616.                            Description
  8617.  
  8618.   If no options are specified, RezDet investigates the resource fork
  8619.   of each file for damage or inconsistencies. The specified files are
  8620.   read and checked one by one. Output is generated according to the
  8621.   options specified.
  8622.  
  8623.   RezDet checks for the following conditions:
  8624.  
  8625.     • The resource fork is at least the minimum size. (There must
  8626.     be enough bytes to read a resource header.)
  8627.  
  8628.     • There is no overlap or space between the header, the resource
  8629.     data list, and the resource map. There should be no bytes between
  8630.     the EOF and the end of the resource map.
  8631.  
  8632.     • Each record in the resource data list is used once and only
  8633.     once. The last data item ends exactly where the data list ends.
  8634.  
  8635.     • Each item in the resource type list contains at least one reference;
  8636.     each sequence of referenced items starts where the previous resource
  8637.     type item’s reference list ended; and each item in the reference
  8638.     list is pointed to by one and only one resource type list item.
  8639.  
  8640.     • There are no duplicates in the resource type list.
  8641.  
  8642.     • Each name in the name list has one and only one reference,
  8643.     and the last name doesn’t point outside the name list.
  8644.  
  8645.     • There are no duplicate names in the name list. Duplicate names
  8646.     cause an advisory warning rather than a true error. This warning
  8647.     is given only if the -s, -d, or -r option is selected.
  8648.  
  8649.     • Each reference list item points to a valid data item and either
  8650.     has a name list offset of –1 or points to a valid name list offset.
  8651.  
  8652.     • Bits 7 (Unused), 1 (Changed), or 0 (Unused) should not be set
  8653.     in the resource attributes.
  8654.  
  8655.     • All names have a nonzero length.
  8656.  
  8657.   Fields are displayed as hexadecimal or decimal for numeric values,
  8658.   or as a hex dump with associated printable Macintosh characters.
  8659.   The characters newline ($0D), tab ($09) and null ($00) are displayed
  8660.   as "¬", "Δ", and ".", respectively.
  8661.  
  8662.     • Note: RezDet does not use the Resource Manager and should not
  8663.     crash, no matter how corrupt the resource fork of the file.
  8664.  
  8665.  
  8666.                              Examples
  8667.  
  8668.   RezDet {SystemFolder}System
  8669.  
  8670.   Checks the System file for damage.
  8671.  
  8672.   RezDet -q Foo || Delete Foo
  8673.  
  8674.   Removes the file Foo if the resource fork is damaged.
  8675.  
  8676.   Limitations Duplicate resource name warnings are generated even if
  8677.   the names belong to resources of different types.
  8678.  
  8679.   The file attributes field in the resource map header is not validated.
  8680.  
  8681.   The Finder-specific fields in the header and resource map header
  8682.   are ignored.
  8683.  
  8684. æKY RotateWindows
  8685. æC       RotateWindows -- send active (frontmost) window to back
  8686.  
  8687. RotateWindows [-r]
  8688.  -r                      # reverse rotation; bring bottom window to front
  8689.  
  8690. Status codes returned:
  8691.   0    No errors.
  8692.   1    Syntax error (error in parameters).
  8693.  
  8694.                            Description
  8695.  
  8696.   RotateWindows places the front MPW window in the back and brings
  8697.   the second window to the front. Multiple calls to RotateWindows rotate
  8698.   through all open MPW windows. RotateWindows brings only MPW windows
  8699.   to the front (desk accessory windows are not rotated). You might
  8700.   want to add this command to a menu, along with a command key equivalent.
  8701.   For example:
  8702.  
  8703.   AddMenu 'Extras' 'RotateWindows/®' 'RotateWindows'
  8704.  
  8705.  
  8706.                              Examples
  8707.  
  8708.   RotateWindows
  8709.  
  8710.   Puts the front MPW window in back, and brings the target MPW window
  8711.   to the front.
  8712.  
  8713.  
  8714.                              See also 
  8715.  
  8716.   StackWindows, SizeWindow, MoveWindow, and ZoomWindow commands.
  8717.  
  8718. æKY Save
  8719. æC                    Save -- save specified windows
  8720.  
  8721. Save [-a | window…]
  8722.  -a                      # save the contents of all windows
  8723.  
  8724. Status codes returned:
  8725.   0    No errors.
  8726.   1    Syntax error.
  8727.   2    Specified window does not exist.
  8728.  
  8729.                            Description
  8730.  
  8731.   Saves the contents of window or a list of windows to disk without
  8732.   closing them. The -a option saves all open windows. Save without
  8733.   any parameters saves the target window (the second window from the
  8734.   front).
  8735.  
  8736.  
  8737.                              Examples
  8738.  
  8739.   Save -a
  8740.  
  8741.   Saves all open windows.
  8742.  
  8743.   Save {Active} {Worksheet}
  8744.  
  8745.   Saves the Worksheet window and the contents of the active window.
  8746.  
  8747.  
  8748.                              See also 
  8749.  
  8750.   Close and Revert commands.
  8751.       
  8752. æKY SaveOnClose
  8753. æC                    SaveOnClose -- set save behavior when closing windows
  8754.  
  8755. SaveOnClose [-a | -d | -n] [window…]
  8756.  -a                  # always save upon close ("Close -y")
  8757.  -d                  # default behavior for Close
  8758.  -n                  # never save upon close ("Close -n")
  8759.  
  8760.                            Description
  8761.                                                                                  
  8762. This command selects an automatic behavior: save, do not save, or ask
  8763. whether to save when closing a window.  The -n option does not turn off 
  8764. the Save menu item, allowing the user to request saving explicitly. 
  8765.                                                                            
  8766.  
  8767. æKY Search
  8768. æC                  Search -- search files for pattern
  8769.  
  8770. Search [-b] [-s | -i] [-nf] [-r] [-q] [-f file] pattern [file…] < file > found
  8771.  -b                 # break "File/Line" from matched pattern
  8772.  -i                 # case insensitive search (overriding {CaseSensitive})
  8773.  -s                 # case sensitive search (overriding {CaseSensitive})
  8774.  -nf                # write "pattern not found" to standard error and set status = 2
  8775.  -ns                # return 0 when pattern not found
  8776.  -q                 # suppress file name and line number in output
  8777.  -r                 # write non-matching line to standard output
  8778.  -sf                # stop at first match
  8779.  -f file            # lines not written to output are put in this file
  8780.  
  8781. Status codes returned:
  8782.   0    No error.
  8783.   1    Syntax error.
  8784.   2    Pattern not found.
  8785.  
  8786.                            Description
  8787.  
  8788.   Searches the input files for lines that contain a pattern and writes
  8789.   those lines to standard output. If no file is given, standard input
  8790.   is searched. When reading from files, the filenames and line numbers
  8791.   of matching lines are prepended to each line of output.
  8792.  
  8793.   Pattern (defined in "Pattern Matching" in Chapter 6 of the MPW manual and 
  8794.   in Appendix B) is a regular expression, optionally enclosed in forward 
  8795.   slashes ( / ).
  8796.  
  8797.  
  8798.                              Examples
  8799.  
  8800.   Search /procedure/ Sample.p
  8801.  
  8802.   Searches the file Sample.p for the pattern "procedure". All lines
  8803.   containing this pattern are written to standard output.
  8804.  
  8805.   Search /Export/ {MPW}StartUp {MPW}UserStartUp
  8806.  
  8807.   Lists the Export commands in the StartUp and UserStartup files.
  8808.  
  8809.   Search /PROCEDURE [a-zA-Z0-9_]*;/ {PInterfaces}≈
  8810.  
  8811.   Searches for the procedures with no parameters in the Pascal interface
  8812.   files supplied with MPW Pascal. Because more than one input file
  8813.   is specified, a filename will precede each line in the output.
  8814.  
  8815.   Search -f file.nonmatch /pattern/ file
  8816.  
  8817.   All lines of "file" that contain "pattern" are written to standard
  8818.   output. All other lines will be placed in file.nonmatch. This, in
  8819.   effect, splits the file in two pieces, using "pattern" as the key.
  8820.  
  8821.   Search -r -f file.nonmatch /pattern/ file
  8822.  
  8823.   This does the opposite of the preceding example. All lines that do
  8824.   not contain "pattern" are echoed to standard output, and all other
  8825.   lines (that is, those containing "pattern") are written to file.nonmatch.
  8826.  
  8827.  
  8828.                              See also 
  8829.  
  8830.   Find command.
  8831.  
  8832.   "Pattern Matching (Using Regular Expressions)" in Chapter 6.
  8833.  
  8834. æKY Set
  8835. æC               Set -- define or write Shell variables
  8836.  
  8837. Set [name [value]]   > variableList
  8838.  
  8839. Status codes returned:
  8840.   0    No error.
  8841.   1    Syntax error.
  8842.   2    Variable "name" does not exist.
  8843.  
  8844.                            Description
  8845.  
  8846.   Set assigns the string value to the variable name. If value is omitted,
  8847.   Set writes the name and its current value to standard output. If
  8848.   both name and value are omitted, Set writes a list of all variables
  8849.   and their values to standard output. (This output is in the form
  8850.   of Set commands.)
  8851.  
  8852.     • Note: To make variable definitions available to enclosed scripts
  8853.     and programs, you must use the Export command.
  8854.  
  8855.  
  8856.                              Examples
  8857.  
  8858.   Set CIncludes "{MPW}CFiles:CIncludes:"
  8859.  
  8860.   Redefines the variable CIncludes.
  8861.  
  8862.   Set CIncludes
  8863.  
  8864.   Displays the new definition of CIncludes.
  8865.  
  8866.   Set Commands ∂
  8867.   ":,{MPW}Tools:,{MPW}Applications:,{MPW}ShellScripts:"
  8868.  
  8869.   Redefines the variable {Commands} to include the directory "{MPW}ShellScripts:".
  8870.   (See Chapter 5 for a complete list of predefined variables.)
  8871.  
  8872.   Set > SavedVariables
  8873.   # ... other commands
  8874.   Execute SavedVariables
  8875.  
  8876.   Writes the values of all variables to file SavedVariables. Because
  8877.   the output of Set is actually Set commands, the file can be executed
  8878.   later to restore the saved variable definitions. This technique is
  8879.   used in the Suspend and Resume scripts to save and restore variable
  8880.   definitions, as well as exports, aliases, and menus.
  8881.  
  8882.  
  8883.                              See also 
  8884.  
  8885.   Export, Unexport, and Unset commands.
  8886.  
  8887.   "Defining and Redefining Variables" in Chapter 5.
  8888.  
  8889.   "The Startup and UserStartup Files" in Chapter 5.
  8890.  
  8891. æKY SetDirectory
  8892. æC             SetDirectory -- set the default directory
  8893.  
  8894. SetDirectory directory
  8895.  
  8896. Status codes returned:
  8897.   0    Successful completion.
  8898.   1    Parameter error or unable to set directory.
  8899.  
  8900.                            Description
  8901.  
  8902.   SetDirectory sets the default directory and adds the new default
  8903.   directory to the Directory menu if it is not already present. The
  8904.   directory parameter must be specified.
  8905.  
  8906.     • Note: Directory names should not contain any of the special
  8907.     characters shown below. These characters all have special meaning
  8908.     when they appear in menu items:
  8909.  
  8910.   - ; ^ ! < / (
  8911.  
  8912.   The SetDirectory script is used to implement the Set Directory menu
  8913.   item in the Directory menu.
  8914.  
  8915.  
  8916.                              Examples
  8917.  
  8918.   SetDirectory {MPW}Scripts:
  8919.  
  8920.   Sets the default directory to the Scripts folder in the {MPW} directory
  8921.   and adds {MPW}Scripts: to the Directory menu if it’s not already
  8922.   there.
  8923.  
  8924.   SetDirectory…
  8925.  
  8926.   Uses the Commando dialog box to select the default directory interactively.
  8927.  
  8928.  
  8929.                              See also 
  8930.  
  8931.   Directory, DirectoryMenu, and Files commands.
  8932.  
  8933. æKY SetFile
  8934. æC                   SetFile -- set file/folder attributes
  8935.  
  8936. SetFile [option…] file/folder…
  8937.  -a attributes         # attributes (lowercase = 0, uppercase = 1)
  8938.  -c creator            # file creator
  8939.  -d date               # creation date (mm/dd/yy [hh:mm[:ss] [AM | PM]])*
  8940.  -l h,v                # ICON location (horizontal,vertical)*
  8941.  -m date               # modification date (mm/dd/yy [hh:mm[:ss] [AM | PM]])*
  8942.  -t type               # file type
  8943.  
  8944.  Note: Period (.) represents the current date and time.
  8945.  Note: The following attributes may be used with the -a option:
  8946.      L   Locked
  8947.      V   Invisible*
  8948.      B   Bundle
  8949.      S   System
  8950.      I   Inited*
  8951.      D   Desktop*
  8952.      M   Shared (can run multiple times)
  8953.      A   Always switch launch (if possible)
  8954. *Note: Options/attributes marked with an asterisk (*) are allowed with folders
  8955.  
  8956. Status codes returned:
  8957.   0    The attributes for all files were set.
  8958.   1    Syntax error.
  8959.   2    An error occurred.
  8960.       
  8961.  
  8962.                            Description
  8963.  
  8964.   Sets attributes for one or more files. The options apply to all files
  8965.   listed.
  8966.  
  8967.  
  8968.                              Examples
  8969.  
  8970.   SetFile -c "MPS " -t MPST ResEqual
  8971.  
  8972.   Sets the creator and type for the MPW Pascal tool ResEqual.
  8973.  
  8974.   SetFile Foo -m "2/15/86 2:25"
  8975.  
  8976.   Sets the modification date of file Foo.
  8977.  
  8978.   SetFile Foo Bar -m .
  8979.  
  8980.   Sets the modification date to the current date and time (the period
  8981.   is a parameter to -m, indicating current date and time). Setting
  8982.   the date is useful, for instance, before running Make.
  8983.  
  8984.  
  8985.                              See also 
  8986.  
  8987.   Files command. (The -l and -x options display file information.)
  8988.  
  8989. æKY SetPrivilege
  8990. æC  SetPrivilege -- set access privileges for directories on file servers
  8991.  
  8992. SetPrivilege [option…] directory…  > information
  8993.     -d privileges           # set privileges for seeing directories
  8994.     -f privileges           # set privileges for seeing files
  8995.     -g group                # make the directories belong to group
  8996.     -i                      # return information on directories
  8997.     -m privileges           # set privileges for making changes
  8998.     -o owner                # make owner the owner of directories
  8999.     -r                      # operate (set or list) recursively
  9000.  
  9001.     Note: The following privilege characters may be used with
  9002.     the -d, -f, or -m options (Upper case enables the privilege,
  9003.     lower case disables it):
  9004.          O   Owner
  9005.          G   Group
  9006.          E   Everyone
  9007.  
  9008. Status codes returned:
  9009.   0    No error.
  9010.   1    Syntax error.
  9011.   2    Folder not found, or folder not an AppleShare folder.
  9012.   3    User is not owner; could not modify privileges.
  9013.  
  9014.                            Description
  9015.  
  9016.   Using SetPrivilege is equivalent to using the access privileges desk
  9017.   accessory. Priv is a character string (one, two or three characters
  9018.   long) that specifies privileges for the owner, the group, and everyone
  9019.   (o, g, and e, respectively). An uppercase letter enables the privilege;
  9020.   a lowercase letter disables the privilege. If a specific character
  9021.   is not in the string, the respective privilege is not changed.
  9022.  
  9023.  
  9024.                              Examples
  9025.  
  9026.   SetPrivilege -r -f OGe -d OGe -m Oge ∂
  9027.   "Server:personal:peter"
  9028.  
  9029.   This gives everyone in your group the ability to see files within
  9030.   Server:personal:peter without being able to change them. Anyone outside
  9031.   the group cannot see the files or folders or make changes. The owner
  9032.   can do everything.
  9033.  
  9034.   Here is the easiest way to use the SetPrivilege command: Use the
  9035.   -i option to get information on folders and edit the privileges as
  9036.   desired. Then execute the resulting command. For example, to change
  9037.   the privileges for Server:Private, follow these steps:
  9038.  
  9039.   1. Execute this command to obtain the current privileges:
  9040.  
  9041.   SetPrivilege -i Server:Private
  9042.  
  9043.   SetPrivilege Server:Private -o Joe -g Team -d OGE -f OGE -m OGE
  9044.  
  9045.     • Note: These privileges show that Joe, the group Team, and everyone
  9046.     else has all privileges to the folder Private.
  9047.  
  9048.   2. Now edit the output, adjusting the privileges as desired. For
  9049.   example,
  9050.  
  9051.   SetPrivilege Server:Private -o Joe -g Team -d Oge -f Oge -m Oge
  9052.  
  9053.     • Note: Now only Joe, the owner, can see directories and files.
  9054.     Only Joe can make changes; all other users have no privileges.
  9055.  
  9056.   3. Execute the resulting command.
  9057.  
  9058. æKY SetVersion
  9059. æC          SetVersion -- maintain version and revision number
  9060.  
  9061. SetVersion [option…] file  > output ≥ progress
  9062.  -b                    # increment the bug fix component by 1
  9063.  -country name         # country code name
  9064.  -csource file         # update the #define Version string in C source
  9065.  -d                    # display (updated) version numbers to standard output
  9066.  -fmt nƒ.mƒ            # format version numbers according to specification
  9067.  -i resid              # use specified resource id instead of 0
  9068.  -p                    # write SetVersion's version info to diagnostic file
  9069.  -prefix prefix        # prefix version with specified prefix
  9070.  -[p]source file       # update the Version string constant in Pascal source
  9071.  -r                    # increment the revision component by 1
  9072.  -rezsource file       # update the resource definition in Rez source
  9073.  -sb bugfix            # set the bug fix component to the specified value
  9074.  -sr revision          # set the revision component to the specified value
  9075.  -stage stage          # set release stage for a 'vers' resource
  9076.  -suffix suffix        # suffix the version with specified suffix
  9077.  -sv version           # set the version component to the specified value
  9078.  -sx nonrel            # set the non-release component to the specified value
  9079.  -sync 1 | 2           # synchronize 'vers',1 with 'vers',2 or vice versa
  9080.  -t type               # use specified resource type
  9081.  -v                    # increment the version component by 1
  9082.  -verid identifier     # use C/Pascal source version id instead of "Version"
  9083.  -version fmtstring    # alternate way of specifying version component actions
  9084.  -verstring longstring # set the long version string of a Finder 'vers' resource
  9085.  -x                    # increment the non-release component by 1
  9086.  
  9087. Status codes returned:
  9088.   0    Normal termination.
  9089.   1    Parameter or option error.
  9090.  
  9091.                            Description
  9092.  
  9093.   SetVersion generates and maintains (sets or increments) the individual
  9094.   components making up a version number for a file. There are two forms
  9095.   of version numbering supported by SetVersion:
  9096.  
  9097.   ver.rev The first version numbering form is "ver.rev", where ver
  9098.   is a version number and rev a revision number. The component values
  9099.   are kept in a private resource generated and maintained by SetVersion
  9100.   itself. The resource is generally used only by applications (for
  9101.   example, in their About box) and MPW tools (for example, when an
  9102.   MPW tool’s -p option is used) that contain code to read the resource.
  9103.   It is also recognized by Commando to be displayed just below the
  9104.   Do It button of a Commando dialog box1.
  9105.  
  9106.   In this form of version numbering, the resource is maintained as
  9107.   a Pascal string with the resource type 'MPST' and a resource ID of
  9108.   0 (you can use the -t and -i options to specify another resource
  9109.   type and ID number if desired). The resource has the following layout
  9110.   (described as Rez input):
  9111.  
  9112.  
  9113.                              Examples
  9114.  
  9115.   setversion -d -sv 1 -r Example -psource Globals -rezsource Example.r
  9116.  
  9117.   The MPW tool Example contains a SetVersion 'MPST' string resource.
  9118.   The above command line increments the revision for the tool (-r)
  9119.   in the resource fork of the file Example. The version is fixed at
  9120.   1 (-sv), so that Example displays the version and revision as "1.rev".
  9121.   The Pascal include file, Globals, contains the tool’s global declarations,
  9122.   including the Version string. This include file is updated to match
  9123.   the 'MPST' resource (-psource). The resource definitions for the
  9124.   tools, in Example.r, will be similarly updated (-rezsource). Finally,
  9125.   this command displays the new version of the standard output file
  9126.   (-d).
  9127.  
  9128.   setversion -d -version 1.Δ Example -psource Globals -rezsource Example.r
  9129.  
  9130.   Same as previous example, but here we illustrate how the -version
  9131.   option serves the same purpose as the -sv and -r options. Here the
  9132.   "Δ" indicates that the revision is to be incremented.
  9133.  
  9134.   setversion -d -version 1.2.%bΔ Example -psource Globals ∂
  9135.   -rezsource Example.r
  9136.  
  9137.   Again an 'MPST' SetVersion string resource is to be generated. But
  9138.   here we use a more complex version number. The version is set to
  9139.   1, the revision to 2, the bug fix level is left alone ("%"), this
  9140.   is a beta (b) release, and finally the nonrelease level is to be
  9141.   incremented.
  9142.  
  9143.   SetVersion SetVersion -psource SetVersion.p -version 3.Δ -t vers -i 1 ∂
  9144.   -d -verstring "^, ©Apple Computer, Inc. 1984-1988, by Ira L. Ruben"
  9145.  
  9146.   SetVersion SetVersion -version 3.0b1 -t vers -i 2 -verstring "MPW
  9147.   3.0b1"
  9148.  
  9149.   This pair of SetVersion commands generates both Finder 'vers',1 and
  9150.   'vers',2 resources. The Finder Get Info display shown earlier illustrates
  9151.   the result of using these commands. The MPW tool, SetVersion, has
  9152.   its own version number, 3.Δ (the revision is incremented for version
  9153.   3) set as a 'vers',1 resource (-t 'vers', -i 1). A long version message
  9154.   is specified by the -verstring option. The version number from the
  9155.   short message string is inserted into the long string at the position
  9156.   indicated by the "^" character. The generated version number is displayed
  9157.   to the standard output (-d) file. It is also used to update the Pascal
  9158.   source file constant (-psource).
  9159.  
  9160.   The second SetVersion command set the 'vers',2 resource (-t 'vers',
  9161.   -i 2). The version is set unconditionally to 3.0b1 and the long message
  9162.   string to "MPW 3.0b1". MPW 3.0b1 is the MPW release, and SetVersion
  9163.   is just one of the files that belong to this release.
  9164.  
  9165.   The last example illustrates how both 'vers' resources should be
  9166.   used. The 'vers',1 resource is the individual file version while
  9167.   the 'vers',2 is the version release of a product that "owns" the
  9168.   file. The last example also should give some idea of how to arrange
  9169.   makefiles, specifically makefile macro definitions, to make the version
  9170.   numbering automatic and general. The following example illustrates
  9171.   this. It is the actual macro definitions and the SetVersion calls
  9172.   used to build SetVersion itself. They are taken as is from SetVersion’s
  9173.   makefile.
  9174.  
  9175.   MPWversion = 3.0b1                # product release version
  9176.   Copyright = ©Apple Computer, Inc. # copyright notice
  9177.   ver2 = MPW {MPWversion}           # long msg string for 'ver',2
  9178.   ver1 = ^, {Copyright}             # long msg string for 'ver',1
  9179.   - - -
  9180.  
  9181.   SetVersionVer = -sv 3 -r          # SetVersion's component controls
  9182.   Stage = -stage rel -sb 0          # Stage used by tools in makefile
  9183.   - - -
  9184.  
  9185.   SetVersion {LinkedTools}SetVersion -psource {ToolsDir}SetVersion.p ∂
  9186.   {SetVersionVer} -t vers -i 1 {stage} -d ∂
  9187.                   -verstring "{ver1} 1984-1988, by Ira L. Ruben"
  9188.  
  9189.   SetVersion {LinkedTools}SetVersion -version {MPWversion} -t vers ∂
  9190.              -i 2 -verstring "{ver2}"
  9191.   - - -
  9192.  
  9193.   The macro definitions specify the common aspects of the build; that
  9194.   is,
  9195.  
  9196.     • {MPWVersion}—the MPW release (which can be changed by a Make -d
  9197.     option when Make is called).
  9198.  
  9199.     • {Copyright}—the copyright string (which is concatenated into
  9200.     the 'vers',1 long message string).
  9201.  
  9202.     • {ver1}—the long string for the 'vers',2 resource (note it uses
  9203.     the MPW release string—we could have used a "^" here), which
  9204.     is to be displayed at the top of the Finder’s Get Info window.
  9205.  
  9206.     • {ver2}—the long string for the 'vers',1 resource (here we do
  9207.     use the "^"), which is to be displayed as the tools’ individual
  9208.     version number (we use only version and revision numbers).
  9209.  
  9210.     • {SetVersionVer}—a macro that defines the numbering control
  9211.     for the individual tool (the makefile is used to make other tools
  9212.     so there is one of these for each individual tool made).
  9213.  
  9214.     • {Stage}—Used just to insure that only ver.rel is generated
  9215.     in the 'vers',1 resource.
  9216.  
  9217.   The two SetVersion calls are similar to the previous example, but
  9218.   here they are part of a makefile, and we use the macros.
  9219.  
  9220.   1 Commando only uses the SetVersion string resource if a "VersionDialog"
  9221.   is specified as part of the Commando resources. If omitted, Commando
  9222.   will look for a 'vers' resource(s).
  9223.  
  9224.   2 When Commando uses a 'vers' resource, it first will look for a
  9225.   'vers' ,1 resource, and if not present, a 'vers' ,2 resource. The
  9226.   short version string is displayed below the Do It button. Clicking
  9227.   this version number causes the long version string to be displayed
  9228.   in the "help" box. The two 'vers' resources as well as the strings
  9229.   they contain are described when the 'vers' resource format is described.
  9230.  
  9231.   3 The comparison of the BCD field is only valid if the version number
  9232.   components don’t exceed the limitations imposed by the resource.
  9233.   Specifically, the version and nonrelease values are limited to two
  9234.   BCD digits, while the revision and bug fix values are limited to
  9235.   one digit. Because of these limitations, SetVersion does not use
  9236.   the BCD value. SetVersion does, however, place the low-order digits
  9237.   of the actual version components (maintained in the short message)
  9238.   into the BCD fields. The BCD field is thus valid until the version
  9239.   counts exceed the corresponding BCD limitations.
  9240.  
  9241.   4 See the -t option for a summary of which options are valid as a
  9242.   function of which resource (SetVersion’s string or Finder’s 'vers'
  9243.   resource) is being manipulated.
  9244.  
  9245.   5 The country names are spelled exactly as specified in Inside Macintosh
  9246.   for the International Utilities.
  9247.  
  9248. æKY Shift
  9249. æC         Shift -- renumber command file positional parameters
  9250.  
  9251. Shift [number]
  9252.  
  9253. Status codes returned:
  9254.   0    Success.
  9255.   1    Syntax error.
  9256.  
  9257.                            Description
  9258.  
  9259.   Shift renames the command script positional parameters {number+1},
  9260.   {number+2}… to {1}, {2}, and so on. If number is not specified, the
  9261.   default value is 1. Parameter 0 (the command name) is not affected.
  9262.   The variables {Parameters}, {Parameters}, and {#} variables are also
  9263.   modified to reflect the new parameters.
  9264.  
  9265.  
  9266.                              Examples
  9267.  
  9268.   The following script repeats a command once for each parameter:
  9269.  
  9270.   ### Repeat - Repeat a command for several parameters ###
  9271.   #
  9272.   #         Repeat command parameter…
  9273.   #         Execute command once for each parameter in the
  9274.   #         parameter list. You can specify options by
  9275.   #         including them in quotes with the command name.
  9276.   #
  9277.   Set d {1}
  9278.   Loop
  9279.     Shift
  9280.     Break If {1} == ""
  9281.     {cmd} "{1}"
  9282.   End
  9283.  
  9284.   In the preceding example, the Shift command is used to step through
  9285.   the parameters. The Break command tells the loop when all the parameters
  9286.   have been used. You might, for example, use the following Repeat
  9287.   script to compile several C programs with progress information:
  9288.  
  9289.   Repeat 'C -p' Sample.c Count.c Memory.c
  9290.  
  9291.  
  9292.                              See also 
  9293.  
  9294.   "Parameters" in Chapter 5.
  9295.       
  9296. æKY ShowSelection
  9297. æC          ShowSelection -- place the selection within an editor window
  9298.  
  9299. ShowSelection [-t | -b | -c | -n lines | -l line] [window]
  9300.  -t                   # place first line of selection at top of window
  9301.  -b                   # place first line of selection at bottom of window
  9302.  -c                   # center the first line within the window
  9303.  -n lines             # place first line of selection lines from the top
  9304.  -l line              # place line at the top of window
  9305.  
  9306. æKY Shutdown
  9307. æC             Shutdown -- power down or restart the machine
  9308.  
  9309. Shutdown [-y | -n | -c] [-r]
  9310.  -y                  # save all modified windows (avoids dialog)
  9311.  -n                  # do not save any modified windows (avoids dialog)
  9312.  -c                  # cancel if a window needs to be saved (avoids dialog)
  9313.  -r                  # restart the machine
  9314.  
  9315. Status codes returned:
  9316.   1    Syntax error.
  9317.   2    Command aborted.
  9318.        Note: Shutdown cannot return a status of 0 because if there are no 
  9319.        errors the command never returns.
  9320.  
  9321.                            Description
  9322.  
  9323.   Shutdown quits MPW and then either shuts down or reboots the Macintosh.
  9324.   The default is shutdown. Before rebooting the computer, the system
  9325.   executes standard quit procedures, asking for confirmation to save
  9326.   modified files, close all windows, and so on.
  9327.  
  9328.     • Note: Under MultiFinder, Shutdown does not give other active
  9329.     applications the chance to save their documents.
  9330.  
  9331.  
  9332.                              Examples
  9333.  
  9334.   Shutdown -y
  9335.  
  9336.   Shuts down the machine, answering "Yes" to any dialogs such as those
  9337.   prompting to save files.
  9338.  
  9339.  
  9340.                              See also 
  9341.  
  9342.   Quit command.
  9343.  
  9344. æKY SizeWindow
  9345. æC                  SizeWindow -- set a window's size
  9346.  
  9347. SizeWindow  [h v] [window]
  9348.  h                       # window width (horizontal)
  9349.  v                       # window height (vertical)
  9350.  
  9351. Status codes returned:
  9352.   0    No errors.
  9353.   1    Syntax error (error in parameters).
  9354.   2    The specified window does not exist.
  9355.   3    The h v size specified is too big.
  9356.  
  9357.                            Description
  9358.  
  9359.   Sets the size of the specified window to be h by v pixels, where
  9360.   h and v are nonnegative integers referring to the horizontal and
  9361.   vertical dimensions, in that order. (Use a blank space to separate
  9362.   the numbers h and v on the command line.) The default window is the
  9363.   target (second from the front) window; a specific window can optionally
  9364.   be specified. If the size specified would cause the window to be
  9365.   too big for the screen, an error is returned.
  9366.  
  9367.  
  9368.                              Examples
  9369.  
  9370.   SizeWindow 200 200
  9371.  
  9372.   Makes the target window 200 pixels square in size.
  9373.  
  9374.   SizeWindow {Active}
  9375.  
  9376.   A SizeWindow command with no parameters displays the size of the
  9377.   specified window:
  9378.  
  9379.   SizeWindow 500 100 {Worksheet}
  9380.  
  9381.   Makes the Worksheet window 500 x 100 pixels in size.
  9382.  
  9383.  
  9384.                              See also 
  9385.  
  9386.   MoveWindow, RotateWindows, StackWindows, TileWindows, and ZoomWindow
  9387.   commands.
  9388.  
  9389. æKY Sort
  9390. æC                  Sort -- sort or merge lines of text
  9391.  
  9392. Sort [option…] [files…]
  9393.  -b                      # skip leading blanks of each field
  9394.  -check                  # check if input is sorted (exit code 5 if not).
  9395.  -d                      # sort fields as decimal numbers
  9396.  -f field[,field]        # specify fields to sort on (see below)
  9397.  -fs string              # specify field separator characters
  9398.  -l                      # convert to lowercase before comparison
  9399.  -merge                  # merge pre-sorted input files
  9400.  -o file                 # specify output file, allows sorting-in-place
  9401.  -p                      # print version and progress information
  9402.  -quote                  # handle fields with quotes
  9403.  -stdin                  # place-holder for standard input (acts like a file)
  9404.  -r                      # reverse order of comparison
  9405.  -t                      # sort fields as text (default)
  9406.  -u                      # convert to uppercase before comparison
  9407.  -unique                 # write only unique output lines
  9408.  -x                      # sort fields as hexadecimal numbers (leading '$'
  9409.                          #   or '0x' is ignored)
  9410.  
  9411.  The comma-separated field specifications (following -f) take the forms:
  9412.  
  9413.          [F][.C][-K][bdlqrtux]
  9414.      or  [F][.C][+N][bdlqrtux]
  9415.  
  9416.  'F' is a field number (0=whole line [default], 1=first word, 2=second word…).
  9417.  'C' is the starting column number (from 1), default=1.
  9418.  'K' is the ending column number >= C, default=infinite.
  9419.  'N' is the maximum number of characters in the field, default=infinite.
  9420.  Only one of '-K' or '+N' can be specified.
  9421.  
  9422.  The local modifier characters 'bdlqrtux' have the same meaning on a
  9423.  per-field basis as -b, -d, -l, -q, -r, -t, -u and -x (which take effect
  9424.  globally).
  9425.  
  9426. Status codes returned:
  9427.   0    No errors.
  9428.   1    Syntax error on command line.
  9429.   2    Any other error.
  9430.   4    Out of memory.
  9431.   5    Input is not sorted.
  9432.  
  9433.                            Description
  9434.  
  9435.   Sort sorts or merges the specified files and prints the result on
  9436.   the standard output. If no input files are specified, standard input
  9437.   is assumed.
  9438.  
  9439.   Fields and Field Specifications
  9440.  
  9441.   The -f option (see "Options" ) precedes a comma-separated list of
  9442.   field specifications. Lines are sorted by extracting and comparing
  9443.   the fields in the order specified until a comparison yields inequality.
  9444.   If a field exists in one line but not the other, the line that possesses
  9445.   the field wins. If neither line has a field, the lines are considered
  9446.   equal. Fields not sorted are output randomly (Sort is not a stable
  9447.   sort).
  9448.  
  9449.   Each of the field specifications takes one of the forms:
  9450.  
  9451.   [F][.C][-K][modifiers]
  9452.  
  9453.   [F][.C][+N][modifiers]
  9454.  
  9455.   F is a field number, C and -K are column numbers, and +N is a character
  9456.   count. Any of the items may be omitted, provided that at least one
  9457.   item appears. The numbers -K and +N are mutually exclusive. Spaces
  9458.   can appear anywhere in the specification (except within numbers),
  9459.   but they must be Shell-quoted.
  9460.  
  9461.   Fields are numbered from 1. A field is a string of characters surrounded
  9462.   by newlines or field separator characters (usually whitespace; see
  9463.   the -fs option). Typically field 1 would be the first word on the
  9464.   line, field 2 the second word, and so on. Field 0 represents the
  9465.   entire line and is the default if a field number is not specified.
  9466.   Field separator characters are treated as normal text (not separators)
  9467.   in field 0.
  9468.  
  9469.   Columns are numbered from 1. If .C is specified, it represents a
  9470.   starting offset into the field, taking into account the (file-dependent)
  9471.   varying width of tab characters, if necessary. .C defaults to 1 if
  9472.   it is not specified.
  9473.  
  9474.   If -K is specified it represents the last column to be included in
  9475.   the field. It defaults to infinity (the maximum K possible) if not
  9476.   specified. Except for field 0, fields are always terminated by field-separator
  9477.   characters, so a large K does not mean "the rest of the line."
  9478.  
  9479.   If +N is specified, it represents the number of characters to be
  9480.   included in the field (this differs from -K in that tabs are always
  9481.   counted as single characters). It defaults to infinity (the maximum
  9482.   N possible) if not specified.
  9483.  
  9484.   Here is a short description of all possible field specifications:
  9485.  
  9486.     F         The entirety of field F.
  9487.     F.C       Columns C…∞ in field F.
  9488.     F.C-K     Columns C…K in field F.
  9489.     F.C+N     N characters starting at column C in field F.
  9490.     F-K       Columns 1…K in field F.
  9491.     F+N       The first N characters in field F.
  9492.     .C        Columns C…∞ in the whole line.
  9493.     .C-K      Columns C…K in the whole line.
  9494.     .C+N      N characters starting at column C in the whole line.
  9495.     -K        Columns 1…K in the whole line.
  9496.     +N        The first N characters of the whole line.
  9497.  
  9498.   A field specification may be followed by one or more modifier characters:
  9499.  
  9500.     r         Reverse order of comparison (reverses -r).
  9501.     b         Ignore leading blanks (reverses -b).
  9502.     q         Interpret quotes when extracting field (reverses -quote).
  9503.     d x t l u Treat field as decimal (d), hexadecimal (x), normal text
  9504.               (t), lowercase text (l) or uppercase text (u). These modifiers are
  9505.               mutually exclusive.
  9506.  
  9507.   These modifiers override the corresponding command line options on
  9508.   a field-by-field basis (r, q, and b flip the meaning of -r, -quote,
  9509.   and -b).
  9510.  
  9511.   When sorting multiple files, each file can have its own tab setting.
  9512.   When comparing column-aligned fields, Sort correctly handles tabs
  9513.   of varying width, even when comparing records from different files.
  9514.  
  9515.  
  9516.                              Examples
  9517.  
  9518.   Sort Able -stdin Baker -o Output
  9519.  
  9520.   Sort the files Able, Baker, and the standard input, with output to
  9521.   file Output.
  9522.  
  9523.   Sort -x -f '2.2+8, 1tr' Frog
  9524.  
  9525.   Sort the file Frog. The first key to sort on consists of eight characters
  9526.   starting at the second column of the second field, treated as a hexadecimal
  9527.   number. The second key to sort on is merely the text of the first
  9528.   field, in reverse order.
  9529.  
  9530.   Sort -p -merge -u one two three infinity
  9531.  
  9532.   Merge the specified files, treating lowercase characters as uppercase.
  9533.   Print version and progress information.
  9534.  
  9535. æKY StackWindows
  9536. æC             StackWindows -- arrange windows diagonally
  9537.  
  9538. StackWindows [-h num] [-v num] [-r top,left,bottom,right] [-i] [windows…]
  9539.  -h num                  # horizontal offset between windows
  9540.  -v num                  # vertical offset between windows
  9541.  -r t,l,b,r              # rectangle in which to stack windows
  9542.  -i                      # include the worksheet
  9543.  windows…                # list of windows to tile
  9544.  
  9545. Status codes returned:
  9546.   0    No errors.
  9547.   1    Syntax error (in parameters).
  9548.  
  9549.                            Description
  9550.  
  9551.   Automatically sizes and moves all of the open Shell windows (except
  9552.   the Worksheet) so that they are staggered diagonally across the screen.
  9553.   Use StackWindows when selecting windows from the Window menu; this
  9554.   makes dealing with many open windows easier.
  9555.  
  9556.   If no windows are specified, all open Shell windows (except the Worksheet)
  9557.   are stacked up. Additionally you can specify the horizontal and vertical
  9558.   staggering constants; otherwise staggering defaults to five pixels
  9559.   horizontally and 20 pixels vertically. You can also include the Worksheet
  9560.   by using the -i option.
  9561.  
  9562.  
  9563.                              Examples
  9564.  
  9565.   StackWindows
  9566.  
  9567.   Stacks all of the Shell windows, excluding the Worksheet, in a neat
  9568.   and orderly fashion.
  9569.  
  9570.   StackWindows -i -v 20 -h 10 {active} {target}
  9571.  
  9572.   Stacks the top two windows, including the Worksheet, with a vertical
  9573.   spacing of 20 pixels and a horizontal spacing of 10 pixels.
  9574.  
  9575.  
  9576.                              See also 
  9577.  
  9578.   MoveWindow, RotateWindow, SizeWindow, TileWindows, and ZoomWindow
  9579.   commands.
  9580.       
  9581. æKY StreamEdit
  9582. æC              StreamEdit -- scriptable text editor
  9583.  
  9584. StreamEdit [option…] file…
  9585.     -d                      # delete lines (don't copy them)
  9586.     -e statements           # add 'statements' to the script
  9587.     -o file                 # direct output to file in a "safe" manner
  9588.     -p                      # print progress information
  9589.     -s file                 # specify a file containing a script to execute
  9590.     -set variable[=string]  # set the value of a variable
  9591.  
  9592.     A script consists of zero or more of:
  9593.     
  9594.         <address> <command>…
  9595.  
  9596.     Addresses take the forms (highest to lowest precedence):
  9597.     
  9598.         ( address )             # override precedence
  9599.         ! address               # match line not matching the address
  9600.         address1 && address2    # match line matching address1 AND address2
  9601.         address1 || address2    # match line matching address1 OR address2
  9602.         address1 , address2     # match address1…address2
  9603.         /regular expression/    # a line that matches the expression
  9604.         •                       # matches BEFORE the first line
  9605.         N                       # matches the Nth line
  9606.         $                       # matches the last line
  9607.         ∞                       # matches AFTER the last line
  9608.  
  9609.     A regular expression starting with 'ç' is case-sensitive.  Any '•' must
  9610.     follow the 'ç'.
  9611.  
  9612.     Commands are:
  9613.     
  9614.         Append <text>           # append text to append buffer
  9615.         Exit [status]           # exit with zero or specified status
  9616.         Change <text>           # set contents of edit buffer
  9617.         Delete                  # clear contents of edit buffer
  9618.         Insert <text>           # append text to insert buffer
  9619.         Next                    # proceed with next line
  9620.         Print <text>            # Print the text
  9621.              [-To file ]        #    directed to the specified file
  9622.              [-AppendTo file]   #    appended to the specified file
  9623.         Replace /pat/ <text>    # do replacement
  9624.                 [-c count]      # specify repeat count (N or ∞)
  9625.         Set variable <text>     # set variable's value
  9626.             [-a]                #    append to variable's current value
  9627.             [-i]                #    insert at front of variable's current value
  9628.         Option AutoDelete       # append "1,$ Delete" to script
  9629.     
  9630.     Where <text> consists of zero or more of:
  9631.     
  9632.         "a string"              # the specified text
  9633.         'a string'              # the specified text
  9634.         .                       # the current line (the edit buffer)
  9635.         variableName            # the contents of the named string variable
  9636.         ®N                      # an "®" variable set by a regular expression
  9637.         -from <filename>        # the next line from the file, where filename
  9638.                                 #    is a string or a variable name
  9639.         -n                      # suppress newline at end
  9640.  
  9641.     If <text> is empty, it defaults to "." (the current line).
  9642.             
  9643.                                        Description
  9644.                                                                                              
  9645. StreamEdit is an "offline" text editor similar to the Unix™ tool sed; it provides scriptable 
  9646. text matching and editing operations.  [It is not compatible with Unix™ sed or awk].  It is 
  9647. useful for making repetitive changes to files, for extracting information from text files, or 
  9648. as a filter.
  9649.  
  9650. StreamEdit takes a script and a set of input files (or standard input, if no input files are 
  9651. specified) and applies each statement in the script to each line of input, writing the output 
  9652. to standard output or the specified output file.
  9653.  
  9654. The script is specified by one or more -e or -s options.  If more than one script is 
  9655. specified, the resulting script is the concatenation of all the scripts.  If no script is 
  9656. specified (and -d is not specified), the script effectively defaults to
  9657.  
  9658.      1,$ Print
  9659.  
  9660. which has the effect of simply copying the input lines to the output.
  9661.  
  9662.  
  9663. A script consists of a series of statements of the form:
  9664.  
  9665.      address-expression command [ ; command … ]
  9666.  
  9667. Commands are separated by newlines or semi-colons.  All the commands following a 
  9668. particular address, up to the next address, are executed when the address matches.
  9669.  
  9670. A command takes the form:
  9671.  
  9672.      command-name [ text-arguments … ]
  9673.  
  9674. Arguments are terminated by newlines and semi-colons (while addresses may span 
  9675. multiple lines).
  9676.  
  9677. Address expressions, commands and command arguments are described below.
  9678.  
  9679.  
  9680. Empty lines are legal.  Comments begin with a sharp sign (#).  Semi-colons are equivalent 
  9681. to line breaks (unless they appear as the first character on a line), as in the Shell, and are 
  9682. used to terminate commands.  Newlines (outside of strings) may be escaped to extend an 
  9683. argument list.
  9684.  
  9685. If a script line contains a semi-colon in the first column, the entire line is treated as a 
  9686. comment by StreamEdit.  This allows you to write StreamEdit scripts that also contain 
  9687. MPW shell commands.  See the Examples section for more details.
  9688.  
  9689.                             Examples
  9690.                                                                                     
  9691.              Extracting the Leaf Part of a File Name
  9692.                                        
  9693. It is sometimes necessary to extract the leaf part of a complete file path name in a Shell 
  9694. script.  The StreamEdit expression:
  9695.  
  9696. /(≈:)*([¬:]*)®1/
  9697.  
  9698. sets the variable ®1 to the part of the file name following the last colon, or the whole file 
  9699. name if there it doesn't contain a colon.  It could be used in a Shell script as a filter:
  9700.  
  9701. # {MPW}Scripts:FilterLeaf
  9702. StreamEdit -d -e '/(≈:)*([¬:]*)®1/ print ®1'
  9703.  
  9704. For example:
  9705.  
  9706. Echo "The:I:Is:Silent:myFile" | FilterLeaf
  9707.  
  9708. would print:
  9709.  
  9710. myFile
  9711.  
  9712.  
  9713.                     Generating Inlines
  9714.                                                             
  9715. This is a script that generates MPW C or C++ inline function declarations from assembly 
  9716. language source.  It's far easier and less error-prone than hand-assembly or cut-and-paste; 
  9717. even though this script depends on the format of the listing file produced by the MPW 
  9718. Assembler, it is better to automate the process.
  9719.  
  9720. The script's usage is:
  9721.  
  9722. MakeCInline assemblyfile.a >outputFile
  9723.  
  9724. Given assembler input something like this:
  9725.  
  9726. ;+
  9727. ;  Inline Pascal string copy
  9728. ;
  9729. ;¥ void pascal_string_copy(char* src, char* dest);
  9730. ;
  9731. ;-
  9732.  proc
  9733.  movem.l (SP),A0-A1
  9734.  moveq   #0,D0
  9735.  move.b  (A1),D0
  9736.  bra.s   @2
  9737. @loop:   move.b   (A1)+,(A0)+
  9738. @2: dbra D0,@loop
  9739.  endproc
  9740.  
  9741. We want the filter to produce an inline declaration something like this:
  9742.  
  9743. void pascal_string_copy(char* src, char* dest) =
  9744. {0x4cef, 0x0300, 0x6b00, 0x1011, 0x6002, 0x10d9, 0x51c8, 0xfffc};
  9745.  
  9746. The character '¥' in the assembler comment marks the declaration; in principle any 
  9747. unique character or string can be used to flag the declaration.
  9748.  
  9749.  
  9750. The script has two parts; the first part contains MPW Shell commands, the rest of the 
  9751. script contains StreamEdit statements.
  9752.  
  9753. The MPW Shell part of the script is:
  9754.  
  9755. # MakeCInline -- make C assembly language inline declarations
  9756. ; asm "{1}" -l
  9757. ; StreamEdit -d -s "`which {0}`" "{1}".lst
  9758. ; Delete "{1}".lst "{1}".o
  9759. ; exit
  9760.  
  9761. It runs the assembler on the input file, producing a listing which is processed by the rest 
  9762. of the script.  Then the temporary files are removed and the MPW Shell part of the script 
  9763. exits; the Exit command ensures that the Shell doesn't execute any StreamEdit statements.
  9764.  
  9765. The invocation of StreamEdit here has an interesting hack; the name of the StreamEdit 
  9766. script to execute is, naturally, the name of the currently executing script.  So we use
  9767.  
  9768. `which {0}`
  9769.  
  9770. which expands into the name of the currently running shell script.
  9771.  
  9772.  
  9773. The rest of the file contains a StreamEdit script that processes the assembly listing 
  9774. produced above.  Here's an example of the assembler's listing output:
  9775.  
  9776. MC680xx Assembler - Ver 3.2d1          21-Nov-89  Page   1
  9777. Copyright Apple Computer, Inc. 1984-1989
  9778.  
  9779. Loc   F Object Code     Addr  MSource Statement
  9780.  
  9781.  case on
  9782.  ;+
  9783.  ;
  9784.  ; ¥ void pascal_string_copy(char* src, char* dest)
  9785.  ;
  9786.  ;-
  9787. 00000                       strcpy   proc   export
  9788. 00000   4CD7 0300            movem.l   (SP),A0-A1
  9789. 00004   7000                 moveq   #0,D0   
  9790. 00006   1011                 move.b   (A1),D0
  9791. 00008   6002        0000C    bra.s   @1
  9792. 0000A   10D9                @loop:   move.b   (A1)+,(A0)+
  9793. 0000C G 51C8 FFFC   0000A   @1:   dbra   D0,@loop
  9794. 00010                                endproc
  9795.  
  9796.                                 end
  9797.  
  9798. Elapsed time: 0.08 seconds.
  9799.  
  9800. Assembly complete - no errors found.  16 lines.
  9801.  
  9802.  
  9803.  
  9804. The opcodes we need are tantalizingly close … but embedded in goop that we need to 
  9805. strip away.  The first job is to extract the inline's declaration and copy it to the output.  
  9806. Hex constants must be separated by commas — we accomplish this with a variable, 
  9807. initially empty, that is set to a comma-and-space when a hex constant is emitted, so that a 
  9808. comma precedes every hex constant but the first one.
  9809.  
  9810. /;¥[ ∂t]*([¬;]*)®1/
  9811.  Print -n ®1 " =∂n{"
  9812.  Set PRECEEDING_COMMA ""
  9813.  Delete
  9814.  
  9815. The regular expression matches the inline declaration in the comment (which can be 
  9816. recognized by virtue of the marker string — "¥" — that we put there).  The text of the 
  9817. inline is extracted, omitting a possible trailing semicolon, and put into the variable ®1.  
  9818. The Print statement emits the inline declaration (in ®1) and extra stuff needed for C 
  9819. inline syntax.  The PRECEEDING_COMMA variable is set to empty, the line is deleted, 
  9820. and processing continues.
  9821.  
  9822.  
  9823. The inline declaration is terminated by an ENDP or an ENDPROC assembler directive:
  9824.  
  9825. /[ ∂t]ENDP/
  9826.  Print "};∂n"
  9827.  Delete
  9828.  
  9829. Next, totally uninteresting lines are deleted.  Examining the assembly listing, we note that 
  9830. the lines with the object code we need invariably contain a hex constant starting in the 
  9831. first column, several spaces (with an optional "G"), and at least one two-byte hex constant.  
  9832. We'll strip every line that doesn't meet these criteria, so there will be less noise to worry 
  9833. about.
  9834.  
  9835. !/•[0-9a-f]+ [ g] [0-9a-f]«4»/
  9836.  Delete
  9837.  
  9838. Then we simply delete any junk that precedes the hex constant we're interested in:
  9839.  
  9840. 1,$ Replace /[0-9a-f]+ [g ] /  ""
  9841.  
  9842. Now the line contains one word of assembler output that we can copy to the output:
  9843.  
  9844. /•([0-9a-f]«4»)®1 /
  9845.  Print -n PRECEEDING_COMMA "0x"®1
  9846.  Set PRECEEDING_COMMA ", "
  9847.  Replace // ""
  9848.  
  9849. We print an optional comma, followed by the hex constant itself.  Then we arrange for 
  9850. future constants to be preceded by a comma, and remove the constant from the front of 
  9851. the line.
  9852.  
  9853. Now we have a problem — there's no way to tell how many more constants have to be 
  9854. processed.  Furthermore, StreamEdit has no control structures for looping, so a count 
  9855. wouldn't help much anyway.  So we resort to a hack, namely, repeating the above code as 
  9856. many times as we're likely to ever need it for a single line of assembler output.
  9857.  
  9858. #
  9859. #  Convert remaining words
  9860. #  (I wish StreamEdit had looping!)
  9861. #
  9862. /•([0-9a-f]«4»)®1 /
  9863.  Print -n ", 0x"®1
  9864.  Replace // ""
  9865. /•([0-9a-f]«4»)®1 /
  9866.  Print -n ", 0x"®1
  9867.  Replace // ""
  9868. /•([0-9a-f]«4»)®1 /
  9869.  Print -n ", 0x"®1
  9870.  Replace // ""
  9871. /•([0-9a-f]«4»)®1 /
  9872.  Print -n ", 0x"®1
  9873.  Replace // ""
  9874.  
  9875. Examination of the assembler output shows that handling five constants on a line is more 
  9876. than enough.  However, if the assembler listing format changes, the script will break.
  9877.  
  9878.  
  9879.                       Unpacking Unix Shell Archives
  9880.                                                                   
  9881. This script unpacks a Unix shell archive, more commonly known as a shar file.  Shar files 
  9882. are used in the Unix community to gather text (say, the sources for a program, including 
  9883. its makefile) into a single file, suitable for transmittal by electronic mail or usenet.
  9884.  
  9885. Shar files typically have the form:
  9886.  
  9887. garbage at the beginning — mail headers and so forth
  9888. sed "s/^X//" >TheFile <<'END_OF_TheFile '
  9889. Xtext of the file
  9890. X  where each line
  9891. X    is preceded by an 'X'
  9892. END_OF_TheFile 
  9893. more files, similarly packed
  9894.  
  9895. The Unix shell and the tool sed cooperate to strip off the 'X's at the beginning of each 
  9896. line, and to direct the output to the correct file.  Unfortunately the MPW Shell does not 
  9897. have this kind of redirection, and StreamEdit is not sed, so we have to come up with our 
  9898. own solution.
  9899.  
  9900. To make matters worse, there is no single format for a shar file — in the Unix community 
  9901. it's "anything goes", as long as the standard Unix tools can unpack it.  A StreamEdit script 
  9902. to unpack an arbitrary shar file would have to closely emulate the Unix environment, 
  9903. which is rather difficult.  In practice, you'll have to tweak this script to handle different 
  9904. kinds of shar files.
  9905.  
  9906.  
  9907. The script starts with the usual MPW Shell commands to start up StreamEdit with the 
  9908. proper script, pass along the command-line parameters, and exit.  No surprises:
  9909.  
  9910. ; streamedit -d -s `which "{0}"` {parameters}
  9911. ; exit
  9912.  
  9913.  
  9914. The variable FILE holds the name of the current output file.  When we see a line beginning 
  9915. with "sed", we extract the output filename (possibly enclosed in quotes) and put it in the 
  9916. variable.
  9917.  
  9918. • Set FILE "DELETE.ME"         # for safety's sake
  9919.  
  9920. /•sed/ &&   (   />[ ∂t]*∂'([¬ ∂t]*)®1∂' /   # sed … >'quotedFile'
  9921.   ||
  9922.   />[ ∂t]*([¬ ∂t>]*)®1 /   # sed … >notQuotedFile
  9923.        )
  9924.   Set FILE ®1
  9925.   print "Extracting " FILE
  9926.  
  9927. For paranoia's sake, the FILE variable is initialized to "DELETE.ME", and the name of each 
  9928. file extracted is printed on standard output.
  9929.  
  9930. Extraction is simple — for every line beginning with an "X", the "X" is stripped off and the 
  9931. line is written to the current destination file.
  9932.  
  9933. /•X/
  9934.  replace // ""
  9935.  print -to FILE
  9936.    
  9937.                             See also
  9938.                                                                                           
  9939. Shell documentation on regular expressions.                                                                                          
  9940.    
  9941. æKY Target
  9942. æC              Target -- make a window the target window
  9943.  
  9944. Target name
  9945.  
  9946. Status codes returned:
  9947.   0    No errors.
  9948.   1    Error in parameters.
  9949.   2    The specified file does not exist.
  9950.   3    System error.
  9951.  
  9952.                            Description
  9953.  
  9954.   Makes window name the target window for editing commands (that is,
  9955.   the second window from the front). If window name isn’t already open,
  9956.   then file name is opened as the target window. If name doesn’t exist,
  9957.   an error is returned.
  9958.  
  9959.  
  9960.                              Examples
  9961.  
  9962.   Target Sample.a
  9963.  
  9964.   Makes the window Sample.a the target window.
  9965.  
  9966.  
  9967.                              See also 
  9968.  
  9969.   Open command.
  9970.  
  9971.   "Editing With the Command Language" in Chapter 5.
  9972.  
  9973. æKY TileWindows
  9974. æC          TileWindows -- arrange windows in a tiled fashion
  9975.  
  9976. TileWindows [-h | -v] [-r top,left,bottom,right] [-i] [windows…]
  9977.  -h                      # tile windows horizontally
  9978.  -v                      # tile windows vertically
  9979.  -r t,l,b,r              # rectangle in which to tile windows
  9980.  -i                      # include the worksheet
  9981.  windows…                # list of windows to tile
  9982.  
  9983. Status codes returned:
  9984.   0    No errors.
  9985.   1    Syntax error (error in parameters).
  9986.  
  9987.                            Description
  9988.  
  9989.   TileWindows automatically sizes and moves the specified Shell windows
  9990.   so that they are all visible on the screen at once. If no windows
  9991.   are specified, all open windows are tiled (except the Worksheet).
  9992.   Arranging your open windows like tiles and then zooming a selected
  9993.   window to full size makes dealing with many open windows much easier.
  9994.  
  9995.  
  9996.                              Examples
  9997.  
  9998.   TileWindows
  9999.  
  10000.   Arranges all of the Shell windows in a tile pattern, so that all
  10001.   are visible.
  10002.  
  10003.   TileWindows -h hd:new:main.c hd:new:foo.c
  10004.  
  10005.   Arranges the specified windows as two long horizontal strips.
  10006.  
  10007.   TileWindows -v {active} {target}
  10008.  
  10009.   Arranges the top two windows vertically.
  10010.  
  10011.  
  10012.                              See also 
  10013.  
  10014.   MoveWindow, RotateWindow, SizeWindow, StackWindows, and ZoomWindow
  10015.   commands.
  10016.  
  10017. æKY TransferCkid
  10018. æC  TransferCkid -- move Projector information from one file to another
  10019.  
  10020. TransferCkid sourceFile destinationFile 
  10021.  
  10022. Status codes returned:
  10023.   0    No errors.
  10024.   1    Syntax error.
  10025.   2    Error in processing.
  10026.  
  10027.                            Description
  10028.  
  10029.   Move the Projector 'CKID' resource from sourcefile to destinationfile.
  10030.  
  10031.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  10032.   symbols used in Projector commands.
  10033.  
  10034. æKY Translate
  10035. æC                  Translate -- translate characters
  10036.  
  10037. Translate [-p] [-s] src [dst] < file > output ≥ progress
  10038.     -p                    # write progress information to diagnostics
  10039.     -s                    # set font, font size, and tab setting of output
  10040.  
  10041. Status codes returned:
  10042.   0    Normal termination.
  10043.   1    Parameter or option error.
  10044.  
  10045.                            Description
  10046.  
  10047.   Standard input is copied to standard output, with input characters
  10048.   specified in the src (source) parameter string mapped into the corresponding
  10049.   characters specified by the dst (destination) parameter string; all
  10050.   other characters are copied as is. If dst is omitted, all characters
  10051.   represented by the src are deleted. If the dst string is shorter
  10052.   than the src, all characters in the src that would map to or beyond
  10053.   the last character in the dst are mapped into the last character
  10054.   in dst, and adjacent instances of such characters in the input are
  10055.   represented by a single instance of the last character in dst.
  10056.  
  10057.   Both src and dst are specified as a standard Shell character list
  10058.   but not enclosed in square brackets. Thus the src and dst are sequences
  10059.   of one or more characters (that is, an abcde) or a range of characters
  10060.   separated by a minus sign (that is, a–z, 0–9). Standard escape characters
  10061.   (such as ,
  10062.  
  10063.     • Note: Case sensitivity of letters specified in the src list
  10064.     are governed by the {CaseSensitive} Shell variable. If CaseSensitive
  10065.     is set to 1, then only letters specified in the src are mapped
  10066.     or deleted. If CaseSensitive is 0, then uppercase and lowercase
  10067.     letters not explicitly mapped into dst characters are mapped
  10068.     identically.
  10069.  
  10070.  
  10071.                              Examples
  10072.  
  10073.   translate a-z A-Z <origFile >ucFile
  10074.  
  10075.   Converts all lowercase letters in origFile to uppercase and writes
  10076.   the translated file to ucFile.
  10077.  
  10078.   translate 0-9 9 <origFile >outFile
  10079.  
  10080.   Converts each string of digits in origFile to the single digit 9
  10081.   in outFile.
  10082.  
  10083.   translate  
  10084.  
  10085.   Converts each run of blanks, tabs, or newline (return) characters
  10086.   in origFile to a single newline character in outFile. This effectively
  10087.   produces an output with just one word on each line. Note that the
  10088.   src string had to be quoted to specify the blank.
  10089.  
  10090.   translate ¬a-zA-Z    <origFile >outFile
  10091.  
  10092.   Removes all punctuation and isolates words by spaces on each line.
  10093.   Here we negated the src character list. Thus all characters except
  10094.   letters and newline characters are replaced with spaces.
  10095.  
  10096. æKY Unalias
  10097. æC                      Unalias -- remove aliases
  10098.  
  10099. Unalias [name…]
  10100.  
  10101. Status codes returned:   
  10102.   0    no errors.
  10103.  
  10104.                            Description
  10105.  
  10106.   Removes any alias definition associated with the alias name. (It
  10107.   is not an error if no definition exists for name.)
  10108.  
  10109.   s Caution If no names are specified, all aliases are removed.  s
  10110.  
  10111.   The scope of the Unalias command is limited to the current script;
  10112.   that is, aliases in enclosing scripts are not affected. If you are
  10113.   writing a script that is to be completely portable across various
  10114.   users’ configurations of MPW, you should place the command
  10115.  
  10116.   Unalias
  10117.  
  10118.   at the beginning of your script to make sure no unwanted substitutions
  10119.   occur.
  10120.  
  10121.  
  10122.                              Examples
  10123.  
  10124.   Unalias File
  10125.  
  10126.   Remove the alias "File". (This alias is defined in the Startup file.)
  10127.  
  10128.  
  10129.                              See also 
  10130.  
  10131.   Alias command.
  10132.  
  10133.   "Command Aliases" in Chapter 5.
  10134.  
  10135. æKY Undo
  10136. æC                     Undo -- undo the last edit
  10137.  
  10138. Undo [window]
  10139.  
  10140. Status codes returned:
  10141.   0    No errors.
  10142.   1    Syntax error (error in parameters).
  10143.   2    Any other error.
  10144.  
  10145.                            Description
  10146.  
  10147.   Undo is the scriptable equivalent of choosing Undo from the Edit
  10148.   menu to reverse the last editing operation. Undo without any parameters
  10149.   acts on the target (that is, the second from the front) window. Optionally
  10150.   a named window can be specified.
  10151.  
  10152.     • Note: Remember that Undo is maintained on a window-by-window
  10153.     basis. Therefore using this command will undo the last edit operation
  10154.     that was performed in the specified window, which may or may
  10155.     not be the last operation actually performed.
  10156.  
  10157.  
  10158.                              Examples
  10159.  
  10160.   Undo
  10161.  
  10162.   Reverses the last edit operation in the target window.
  10163.  
  10164.   Undo {Worksheet}
  10165.  
  10166.   Reverses the last edit operation in the Worksheet window.
  10167.  
  10168.  
  10169.                              See also 
  10170.  
  10171.   Cut, Copy, and Paste commands.
  10172.  
  10173. æKY Unexport
  10174. æC     Unexport -- remove variable definitions from the export list
  10175.  
  10176. Unexport [-r | -s | name…]   > unexports
  10177.  -r                      # generate Export commands for all unexported variables
  10178.  -s                      # print the names only
  10179.  
  10180. Status codes returned:
  10181.   0    No error.
  10182.   1    Syntax error.
  10183.  
  10184.                            Description
  10185.  
  10186.   Removes the specified variables from the list of exported variables.
  10187.   The list of exported variables is local to a script, so unexported
  10188.   variables are removed only from the local list.
  10189.  
  10190.   If no names are specified, a list of unexported variables is written
  10191.   to standard output. The default output of Unexport is in the form
  10192.   of Unexport commands.
  10193.  
  10194.   (A variable that is not exported is considered unexported.)
  10195.  
  10196.  
  10197.                              Examples
  10198.  
  10199.   Set SrcDir HD:source:
  10200.   Export SrcDir # SrcDir is available to scripts and tools
  10201.   …
  10202.   Unexport SrcDir
  10203.  
  10204.   Now the variable SrcDir is no longer available to scripts and tools.
  10205.  
  10206.   Unexport -r
  10207.   Export var1
  10208.   Export var2
  10209.   …
  10210.  
  10211.   This example lists all the variables that are not exported. To export
  10212.   them, simply select and execute all the export commands.
  10213.  
  10214.   To get a list of all the variables that have not been exported, execute
  10215.   this command:
  10216.  
  10217.   Unexport -s
  10218.   var1
  10219.   var2
  10220.   ...
  10221.   varx
  10222.  
  10223.  
  10224.                              See also 
  10225.  
  10226.   Set and Export commands.
  10227.  
  10228. æKY Unmark
  10229. æC               Unmark -- remove a marker from a window
  10230.  
  10231. Unmark name… window
  10232.  
  10233. Status codes returned:
  10234.   0    No errors.
  10235.   1    Syntax error.
  10236.   2    Error in processing.
  10237.   3    System error.
  10238.  
  10239.                            Description
  10240.  
  10241.   Unmark removes the marker(s) name… , from the list of markers available
  10242.   for window. When a window is the current active window, the Mark
  10243.   menu item(s) will be adjusted.
  10244.  
  10245.  
  10246.                              Examples
  10247.  
  10248.   Unmark `Markers` {Target}
  10249.  
  10250.   Removes all markers associated with the target window.
  10251.  
  10252.   Unmark Proc1 {Active}
  10253.  
  10254.   Removes the "Proc1" marker from the active window’s marker list.
  10255.   Because {Active} is by definition the current active window, the
  10256.   Mark menu is also adjusted to reflect the deletion of the "Proc1"
  10257.   marker.
  10258.  
  10259.   Limitation Unmark does not support Undo.
  10260.  
  10261.  
  10262.                              See also 
  10263.  
  10264.   "Markers" in Chapter 6.
  10265.  
  10266. æKY Unmount
  10267. æC                     Unmount -- unmount volumes
  10268.  
  10269. Unmount volume…
  10270.  
  10271. Status codes returned:
  10272.   0    The volume was successfully unmounted.
  10273.   1    Syntax error.
  10274.   2    An error occurred.
  10275.  
  10276.                            Description
  10277.  
  10278.   Unmounts the specified volumes. A volume name must end with a colon
  10279.   ( : ). If volume is a number without a colon, it’s interpreted as
  10280.   a disk drive number. The unmounted volumes cannot be referenced again
  10281.   until remounted. If you unmount the current volume (the volume containing
  10282.   the current directory), the boot volume becomes the current volume.
  10283.  
  10284.  
  10285.                              Examples
  10286.  
  10287.   Unmount Memos:
  10288.  
  10289.   Unmounts the volume titled Memos.
  10290.  
  10291.   Unmount 1 2
  10292.  
  10293.   Unmounts the volumes in drives 1 (the internal drive) and 2 (the
  10294.   external drive). (The command Eject 1 2 would unmount and eject the
  10295.   volumes.)
  10296.  
  10297.  
  10298.                              See also 
  10299.  
  10300.   Eject and Mount commands.
  10301.  
  10302. æKY UnmountProject
  10303. æC                 UnmountProject -- unmount projects
  10304.  
  10305. UnmountProject -a | Project…
  10306.  -a                      # unmount all mounted projects
  10307.  
  10308. Status codes returned:
  10309.   0    No errors.
  10310.   1    Syntax error.
  10311.   2    Error in processing.
  10312.   3    System error.
  10313.  
  10314.                            Description
  10315.  
  10316.   Unmount projects mounted under Projector.
  10317.  
  10318.   See Chapter 7 of the MPW manual for complete definitions of the terms and 
  10319.   symbols used in Projector commands.
  10320.  
  10321.  
  10322.                              Examples
  10323.  
  10324.   To unmount all mounted projects use:
  10325.  
  10326.   UnmountProject -a
  10327.  
  10328.   To unmount the projects MyProject and YourProject use:
  10329.  
  10330.   UnmountProject MyProject YourProject
  10331.  
  10332.  
  10333.                              See also 
  10334.  
  10335.   MountProject.
  10336.  
  10337. æKY Unset
  10338. æC              Unset -- remove Shell variable definitions
  10339.  
  10340. Unset [name…]
  10341.  
  10342. Status codes returned:
  10343.  0    no errors.
  10344.  
  10345.                            Description
  10346.  
  10347.   Removes any variable definition associated with name. (It’s not an
  10348.   error if no definition exists for name.)
  10349.  
  10350.   • Caution If no names are specified, all variable definitions are
  10351.   removed. This can have serious consequences. For example, the Shell
  10352.   uses the variable {Commands} to locate utilities and applications
  10353.   and uses several other variables to set defaults. The assembler and
  10354.   compilers use variables to help locate include files. (For details,
  10355.   see "Variables Defined in the Startup File" in Chapter 5 of the MPW
  10356.   manual.)
  10357.  
  10358.   The scope of the Unset command is limited to the current script;
  10359.   that is, variables in enclosing scripts are not affected.
  10360.  
  10361.  
  10362.                              Examples
  10363.  
  10364.   Unset CaseSensitive
  10365.  
  10366.   Removes the variable definition for {CaseSensitive}. This turns off
  10367.   case-sensitive searching for the editing commands.
  10368.  
  10369.  
  10370.                              See also 
  10371.  
  10372.   Set, Export, and Unexport commands.
  10373.  
  10374.   "Defining and Redefining Variables" in Chapter 5.
  10375.  
  10376. æKY UserVariables
  10377. æC     UserVariables -- uses Commando to set all the user variables
  10378.  
  10379. æKY Version
  10380. æC                Version -- print the version of the MPW Shell
  10381.  
  10382. æKY VersionList
  10383. æC           VersionList -- print version info from files
  10384.  
  10385. VersionList [option…] [file…]  > versionsReport
  10386.  -all                    # print version info for all files in directory
  10387.  -c creator              # report on files that have the named file creator. 
  10388.                          #   Default is 'MPS '
  10389.  -d                      # include modification date in report
  10390.  -h                      # suppress the report header and footer
  10391.  -l                      # don't truncate very long file names
  10392.  -newer date             # report on files whose modification date is 
  10393.                          #   newer than date
  10394.  -older date             # report on files whose modification date is 
  10395.                          #   older than date
  10396.  -p                      # write progress information to diagnostic output
  10397.  -r                      # recursively search subdirectories
  10398.  -raw                    # suppress all formatting.  Print tab-delimited columns
  10399.  -t type                 # report on files that have the named file type. 
  10400.                          #   Default is 'MPST'
  10401.  -u path                 # start search at <path>. Default is {MPW}Tools:
  10402.  -v                      # include 'vers' 2 resource info in report
  10403.  
  10404. Status codes returned:
  10405.   0    No errors.
  10406.   1    Syntax error.
  10407.   2    Error in processing.
  10408.   3    System error.
  10409.   -9   User abort.
  10410.   
  10411.                            Description
  10412.                            
  10413. VersionList lists the version numbers of specified files. If no files are
  10414. specified, VersionList reports on MPW tools in the "{MPW}"Tools:
  10415. directory. It obtains the versions from the files’ “vers” resources.
  10416.  
  10417.                              Examples
  10418.                              
  10419. VersionList -v -d
  10420.  
  10421.  
  10422. # ---------------------------------------------------------------------
  10423. # VersionList Report
  10424. # Report Date: 6/24/91
  10425. # Report Root: "HD:MPW:Tools:"
  10426.  
  10427. # File Name         Version     Release     Modification Date
  10428. # ---------------------------------------------------------------------
  10429.  
  10430.   Asm386            1.0b        1.0b         5/13/91
  10431.   Backup            2.131       3.2          4/23/91
  10432.   BigBrother        1.1a8       1.1a8        6/23/91
  10433.   C                 3.2         3.2          4/ 6/91
  10434.   COptimizer        0.9         n/a          6/24/91
  10435.   Choose            n/a         3.2          4/ 6/91
  10436.   Commando          3.2         3.2          4/17/91
  10437.   Compare           5.1         3.2          4/ 6/91
  10438.   Count             n/a         3.2          4/ 6/91
  10439.   DeRez             3.2         3.2          4/ 6/91
  10440.   DumpObj           3.2         3.2          4/ 6/91
  10441.   GetFileName       n/a         3.2          4/ 6/91
  10442.   GetListItem       3.2         3.2          4/ 6/91
  10443.   Lib               3.2         3.2          4/ 6/91
  10444.   Link              3.2         3.2          4/ 6/91
  10445.   Make              3.2         3.2          4/ 6/91
  10446.   NetSwamp          3.2         3.2          4/ 6/91
  10447.   Print             3.2         3.2          4/ 6/91
  10448.   Progresso         4.4         n/a          2/ 5/91
  10449.   ResEqual          2.1         3.2          4/ 6/91
  10450.   Rez               3.2         3.2          4/ 6/91
  10451.   Search            3.2         3.2          4/ 9/91
  10452.   SetVersion        3.46        3.2          4/ 6/91
  10453.   Sort              n/a         3.2          4/ 6/91
  10454.   SysGen            7.0         7.0          5/13/91
  10455.   ThisIsAVeryLong…  n/a         3.2          4/ 6/91
  10456.  
  10457. # ---------------------------------------------------------------------
  10458. # 26 files were found matching your description.
  10459. # A total of 26 files were found.
  10460. # ---------------------------------------------------------------------
  10461.  
  10462.  
  10463. VersionList -d  -r -v -newer 5/1/91
  10464.  
  10465.  
  10466. # ---------------------------------------------------------------------
  10467. # VersionList Report
  10468. # Report Date: 6/24/91
  10469. # Report Root: "HD:MPW:Tools:"
  10470.  
  10471. # File Name         Version     Release     Modification Date
  10472. # ---------------------------------------------------------------------
  10473.  
  10474.   Asm386            1.0b        1.0b         5/13/91
  10475.   BigBrother        1.1a8       1.1a8        6/23/91
  10476.   COptimizer        0.9         n/a          6/24/91
  10477.   SysGen            7.0         7.0          5/13/91
  10478.  
  10479. # ---------------------------------------------------------------------
  10480. # 4 files were found matching your description.
  10481. # A total of 26 files were found.
  10482. # ---------------------------------------------------------------------
  10483.                             
  10484. æKY Volumes
  10485. æC                   Volumes -- list mounted volumes
  10486.  
  10487. Volumes [-l] [-q] [volume…]  > volumeList
  10488.  -l                      # long format (name, drive, size, free, files, dirs)
  10489.  -q                      # don't quote volume names with special characters
  10490.  
  10491. Status codes returned:
  10492.   0    No errors.
  10493.   1    Syntax error.
  10494.   2    No such volume.
  10495.  
  10496.                            Description
  10497.  
  10498.   For each volume named, Volumes writes its name and any other information
  10499.   requested to standard output. The output is sorted alphabetically.
  10500.   A volume name must end with a colon ( : )—if volume is a number without
  10501.   a colon, it’s interpreted as a disk drive number. If volume is not
  10502.   given, all mounted volumes are listed.
  10503.  
  10504.  
  10505.                              Examples
  10506.  
  10507.   Volumes -l
  10508.  
  10509.   will write information such as
  10510.  
  10511.   Name   Drive   Size    Free   Files  Dirs
  10512.   _____ ______  _____   _____  ______ _____
  10513.   HD:      3    19171K  14242K    290   33
  10514.  
  10515.   Files `Volumes 1`
  10516.  
  10517.   Lists the files on the disk in drive 1 (the built-in 3.5-inch disk
  10518.   drive).
  10519.  
  10520. æKY WhereIs
  10521. æC               WhereIs  -- find the location of a file
  10522.  
  10523. WhereIs [-c] [-d] [-v] [-s directory]… pattern
  10524.  -c                      # completely match filepattern
  10525.  -d                      # include directories
  10526.  -v                      # verbose output - put summary line at end
  10527.  -s directory            # starting directory/volume for search
  10528.  
  10529. Status codes returned:
  10530.   0    No errors.
  10531.   1    Syntax error.
  10532.   2    File system error during processing.
  10533.   3    No matches were found.
  10534.  
  10535.                            Description
  10536.  
  10537.   Use WhereIs to find the location of all files that contain pattern
  10538.   as part of their filename. You can use WhereIs to find files hidden
  10539.   in the directory tree. Pattern is a full or partial filename. For
  10540.   example, a pattern of "test" will match TestProg.c, test.c, and Work:OutputTest.
  10541.   WhereIs starts searching in the root directory of the default volume
  10542.   and searches the entire disk. To constrain the search to a portion
  10543.   of a disk, or to specify different disks or multiple disks, use the
  10544.   -s option. To list any directories that contain pattern, use the
  10545.   -d option. To constrain the search to files that completely match
  10546.   pattern, use the -c option. The -v option prints the number of items
  10547.   matched with pattern. Matching is not case sensitive, and regular
  10548.   expressions are not supported.
  10549.  
  10550.   WhereIs lists the full pathname of all files and directories found.
  10551.   Files that contain special characters are quoted.
  10552.  
  10553.  
  10554.                              Examples
  10555.  
  10556.   WhereIs test
  10557.  
  10558.   Find all files that have "test" in their filename. The output would
  10559.   be something like
  10560.  
  10561.   HD:MPW:test.c
  10562.   HD:MPW:test.c.o
  10563.   HD:MPW:TestMenu.c
  10564.   HD:MPW:TestProg.p
  10565.  
  10566.   WhereIs -c test.c
  10567.  
  10568.   Find files named test.c. The output (with the same files as the example
  10569.   above) would be
  10570.  
  10571.   HD:MPW:test.c
  10572.  
  10573.   WhereIs -d test
  10574.  
  10575.   Find all files or directories that have "test" in their leafname.
  10576.   The output would be
  10577.  
  10578.   HD:MPW:TestDir:
  10579.   HD:MPW:test.c
  10580.   HD:MPW:test.c.o
  10581.   HD:MPW:TestMenu.c
  10582.   HD:MPW:TestProg.p
  10583.  
  10584.   WhereIs -s HD:MPW -s Disk2:Work test
  10585.  
  10586.   Find all files that have "test" in their pathname. Search for the
  10587.   files starting in HD:MPW and also in Disk2:Work.
  10588.  
  10589. æKY Which
  10590. æC         Which -- determine which file the shell will execute
  10591.  
  10592. Which [-a] [-p] [name]  > file ≥ progress
  10593.  -a                      # report all commands named "name"
  10594.  -p                      # writes progress information to diagnostics
  10595.  
  10596. Status codes returned:
  10597.   0    No error.
  10598.   1    Syntax error.
  10599.   2    Command not found.
  10600.   3    Other error.
  10601.  
  10602.                            Description
  10603.  
  10604.   Determines which command the Shell will execute when command is entered.
  10605.   Which looks for commands defined by aliases, Shell built-in commands,
  10606.   and commands accessible through the Shell variable {Commands} (the
  10607.   same order the Shell uses). If command is not specified, all paths
  10608.   in the {Commands} variable will be written to standard output, one
  10609.   directory per line. The directories are listed in the order in which
  10610.   the Shell would search for commands. In this case the -a and -p options
  10611.   have no meaning.
  10612.  
  10613.  
  10614.                              Examples
  10615.  
  10616.   Which asm
  10617.  
  10618.   This command outputs something like - HD:MPW:Tools:asm. The Shell
  10619.   then executes hd:MPW:Tools:asm when given asm.
  10620.  
  10621.   Which -a makeit
  10622.   Alias makeit 'make > tmp; tmp'
  10623.   HD:MPW:Tools:makeit
  10624.   HD:MPW:Scripts:makeit
  10625.  
  10626.   In this case, there are three different "makeit" commands that the
  10627.   Shell could execute, as determined by current aliases and the {Commands}
  10628.   variable. The Shell executes the first one found (the alias).
  10629.  
  10630.   Which newfolder
  10631.  
  10632.   newfolder
  10633.  
  10634.   In this case, newfolder is a Shell built-in command.
  10635.  
  10636. æKY Windows
  10637. æC                      Windows  -- list windows
  10638.  
  10639. Windows [-q]
  10640.  -q                      # don't quote window names with special characters
  10641.  -o                      # list "Open" command lines for execution
  10642.  
  10643. Status codes returned:
  10644.   0    No error.
  10645.   1    Syntax error.
  10646.  
  10647.                            Description
  10648.  
  10649.   Writes the full pathname of each file currently in a window. The
  10650.   names are written to standard output, one per line, from backmost
  10651.   to frontmost.
  10652.  
  10653.  
  10654.                              Examples
  10655.  
  10656.   Windows
  10657.  
  10658.   Lists the pathnames of all open windows.
  10659.  
  10660.   Print {PrintOptions} `Windows`
  10661.  
  10662.   Prints the pathnames of the open windows, using the options specified
  10663.   by the {PrintOptions} variable. This example uses command substitution:
  10664.   Because the Windows command appears in backquotes (`…`), its output
  10665.   supplies the parameters to the Print command.
  10666.  
  10667.   Echo "Open `Windows` || Set Status 0" > SavedWindows
  10668.  
  10669.   Writes a script in the file SavedWindows that will reopen the current
  10670.   set of open windows. Notice how Echo is used to create the script.
  10671.   The conditional || execution operator restores the status to zero
  10672.   should an error occur while opening the remembered windows. This
  10673.   technique is used in the script Suspend to save the list of open
  10674.   windows.
  10675.  
  10676. æKY ZoomWindow
  10677. æC           ZoomWindow -- enlarge or reduce a window's size
  10678.  
  10679. ZoomWindow [-b | -s] [window]
  10680.  -b                      # zoom to full screen (big)
  10681.  -s                      # zoom back to regular size (small)
  10682.  
  10683. Status codes returned:
  10684.   0    No errors.
  10685.   1    Syntax error (error in parameters).
  10686.   2    The specified window does not exist.
  10687.  
  10688.                            Description
  10689.  
  10690.   Zooms the specified window according to the option specified. The
  10691.   default window is the target (second from the front) window; a specific
  10692.   window can optionally be specified. The -s option forces the window
  10693.   to zoom back to its small size. The -b option forces the window to
  10694.   zoom to its full size. If no option is specified, the window toggles
  10695.   to the other size. ZoomWindow without any options mimics the operation
  10696.   of clicking in the window’s zoom box. This command is especially
  10697.   valuable when used in conjunction with StackWindows or TileWindows.
  10698.  
  10699.                              Examples
  10700.  
  10701.   ZoomWindow
  10702.  
  10703.   Zooms the target window to full screen size if the window was originally
  10704.   in the small size.
  10705.  
  10706.   ZoomWindow -s {Worksheet}
  10707.  
  10708.   Zooms the Worksheet window back to its small size.
  10709.  
  10710.  
  10711.                              See also 
  10712.  
  10713.   MoveWindow, RotateWindows, SizeWindow, StackWindows, and TileWindows
  10714.   commands.
  10715.  
  10716.   {ZoomWindowRect} variable in Chapter 5.
  10717.  
  10718.   The "full size" window is normally the entire screen. You can change
  10719.   it (for example, prevent it from covering the disk and trash icons)
  10720.   by specifying a rectangle in the Shell variable {ZoomWindowRect}.
  10721.